xref: /freebsd/lib/libsysdecode/sysdecode_fcntl_arg.3 (revision ea4042246d618ed67275ed8fc0685c1dd6bcb8e5)
19289f547SJohn Baldwin.\"
29289f547SJohn Baldwin.\" Copyright (c) 2016 John Baldwin <jhb@FreeBSD.org>
39289f547SJohn Baldwin.\"
49289f547SJohn Baldwin.\" Redistribution and use in source and binary forms, with or without
59289f547SJohn Baldwin.\" modification, are permitted provided that the following conditions
69289f547SJohn Baldwin.\" are met:
79289f547SJohn Baldwin.\" 1. Redistributions of source code must retain the above copyright
89289f547SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer.
99289f547SJohn Baldwin.\" 2. Redistributions in binary form must reproduce the above copyright
109289f547SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer in the
119289f547SJohn Baldwin.\"    documentation and/or other materials provided with the distribution.
129289f547SJohn Baldwin.\"
139289f547SJohn Baldwin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
149289f547SJohn Baldwin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
159289f547SJohn Baldwin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
169289f547SJohn Baldwin.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
179289f547SJohn Baldwin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
189289f547SJohn Baldwin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
199289f547SJohn Baldwin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
209289f547SJohn Baldwin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
219289f547SJohn Baldwin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
229289f547SJohn Baldwin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
239289f547SJohn Baldwin.\" SUCH DAMAGE.
249289f547SJohn Baldwin.\"
252edb60b9SJohn Baldwin.Dd November 24, 2017
269289f547SJohn Baldwin.Dt sysdecode_fcntl_arg 3
279289f547SJohn Baldwin.Os
289289f547SJohn Baldwin.Sh NAME
299289f547SJohn Baldwin.Nm sysdecode_fcntl_arg ,
309289f547SJohn Baldwin.Nm sysdecode_fcntl_arg_p
319289f547SJohn Baldwin.Nd output description of fcntl argument
329289f547SJohn Baldwin.Sh LIBRARY
339289f547SJohn Baldwin.Lb libsysdecode
349289f547SJohn Baldwin.Sh SYNOPSIS
359289f547SJohn Baldwin.In sysdecode.h
369289f547SJohn Baldwin.Ft void
379289f547SJohn Baldwin.Fn sysdecode_fcntl_arg "FILE *fp" "int cmd" "uintptr_t arg" "int base"
389289f547SJohn Baldwin.Ft bool
399289f547SJohn Baldwin.Fn sysdecode_fcntl_arg_p "int cmd"
409289f547SJohn Baldwin.Sh DESCRIPTION
419289f547SJohn BaldwinThe
429289f547SJohn Baldwin.Fn sysdecode_fcntl_arg
439289f547SJohn Baldwinfunction outputs a text description of the optional
449289f547SJohn Baldwin.Fa arg
459289f547SJohn Baldwinargument to
469289f547SJohn Baldwin.Xr fcntl 2
479289f547SJohn Baldwinto the stream
489289f547SJohn Baldwin.Fa fp .
499289f547SJohn BaldwinThe type and format of
509289f547SJohn Baldwin.Fa arg
519289f547SJohn Baldwinare determined by
529289f547SJohn Baldwin.Fa cmd :
539289f547SJohn Baldwin.Bl -column ".Dv F_SETLKW" "Vt struct flock *"
549289f547SJohn Baldwin.It Sy Command Ta Fa arg Sy Type Ta Sy Output Format
559289f547SJohn Baldwin.It
569289f547SJohn Baldwin.It Dv F_SETFD Ta Vt int Ta
57*ea404224SRicardo Branco.Dq FD_CLOEXEC ,
58*ea404224SRicardo Branco.Dq FD_CLOFORK
599289f547SJohn Baldwinor the value of
609289f547SJohn Baldwin.Fa arg
619289f547SJohn Baldwinin the indicated
629289f547SJohn Baldwin.Fa base
639289f547SJohn Baldwin.Pq one of 8, 10, or 16 .
649289f547SJohn Baldwin.It
659289f547SJohn Baldwin.It Dv F_SETFL Ta Vt int Ta
669289f547SJohn BaldwinFile flags as output by
679289f547SJohn Baldwin.Xr sysdecode_fcntl_fileflags 3
689289f547SJohn Baldwinwith any unknown or remaining bits output in hexadecimal.
699289f547SJohn Baldwin.It
709289f547SJohn Baldwin.It Dv F_GETLK Ta Vt struct flock * Ta
719289f547SJohn Baldwin.It Dv F_SETLK Ta Vt struct flock * Ta
729289f547SJohn Baldwin.It Dv F_SETLKW Ta Vt struct flock * Ta
739289f547SJohn BaldwinThe value of
749289f547SJohn Baldwin.Fa arg
759289f547SJohn Baldwinusing the
769289f547SJohn Baldwin.Dq %p
779289f547SJohn Baldwinconversion specification.
789289f547SJohn Baldwin.It
799289f547SJohn Baldwin.It Others Ta Vt int Ta
809289f547SJohn BaldwinThe value of
819289f547SJohn Baldwin.Fa arg
829289f547SJohn Baldwinin the indicated
839289f547SJohn Baldwin.Fa base
849289f547SJohn Baldwin.Pq one of 8, 10, or 16 .
859289f547SJohn Baldwin.El
869289f547SJohn Baldwin.Pp
879289f547SJohn BaldwinThe
889289f547SJohn Baldwin.Fn sysdecode_fcntl_arg_p
899289f547SJohn Baldwinfunction can be used to determine if a
909289f547SJohn Baldwin.Xr fcntl 2
919289f547SJohn Baldwincommand uses the optional third argument to
929289f547SJohn Baldwin.Xr fcntl 2 .
939289f547SJohn BaldwinThe function returns
949289f547SJohn Baldwin.Dv true
959289f547SJohn Baldwinif
969289f547SJohn Baldwin.Fa cmd
979289f547SJohn Baldwinaccepts a third argument to
989289f547SJohn Baldwin.Xr fcntl 2
999289f547SJohn Baldwinand
1009289f547SJohn Baldwin.Dv false
1019289f547SJohn Baldwinif it does not.
1029289f547SJohn Baldwin.Sh RETURN VALUES
1039289f547SJohn BaldwinThe
1049289f547SJohn Baldwin.Nm sysdecode_fcntl_arg_p
1059289f547SJohn Baldwinfunction returns
1069289f547SJohn Baldwin.Dv true
1079289f547SJohn Baldwinif
1089289f547SJohn Baldwin.Fa cmd
1099289f547SJohn Baldwinaccepts a third argument to
1109289f547SJohn Baldwin.Xr fcntl 2
1119289f547SJohn Baldwinand
1129289f547SJohn Baldwin.Dv false
1139289f547SJohn Baldwinif it does not.
1149289f547SJohn Baldwin.Sh SEE ALSO
1159289f547SJohn Baldwin.Xr sysdecode 3 ,
1169289f547SJohn Baldwin.Xr sysdecode_fcntl_cmd 3 ,
1179289f547SJohn Baldwin.Xr sysdecode_fcntl_fileflags 3
118