'\" t
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
.\" and Copyright (C) 1993 Michael Haardt, Ian Jackson;
.\" and Copyright (C) 1998 Jamie Lokier;
.\" and Copyright (C) 2002-2010 Michael Kerrisk.
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
.\" Modified 1995-09-26 by Andries Brouwer <aeb@cwi.nl>
or
.I void
is specified if the argument is not required.
-.SS "Duplicating a file descriptor"
+.SS Duplicating a file descriptor
.TP
.BR F_DUPFD " (\fIint\fP)"
Find the lowest numbered available file descriptor
.B O_CLOEXEC
in
.BR open (2).
-.SS "File descriptor flags"
+.SS File descriptor flags
The following commands manipulate the flags associated with
a file descriptor.
Currently, only one such flag is defined:
.BR F_SETFD " (\fIint\fP)"
Set the file descriptor flags to the value specified by
.IR arg .
-.SS "File status flags"
+.SS File status flags
Each open file description has certain associated status flags,
initialized by
.BR open (2)
.\" FIXME . According to POSIX.1-2001, O_SYNC should also be modifiable
.\" via fcntl(2), but currently Linux does not permit this
.\" See http://bugzilla.kernel.org/show_bug.cgi?id=5994
-.SS "Advisory locking"
+.SS Advisory locking
.BR F_GETLK ", " F_SETLK " and " F_SETLKW
are used to acquire, release, and test for the existence of record
locks (also known as file-segment or file-region locks).
and
.BR write (2)
instead.
-.SS "Mandatory locking"
+.SS Mandatory locking
(Non-POSIX.)
The above record locks may be either advisory or mandatory,
and are advisory by default.
The Linux implementation of mandatory locking is unreliable.
See BUGS below.
-.SS "Managing signals"
+.SS Managing signals
.BR F_GETOWN ,
.BR F_SETOWN ,
.BR F_GETOWN_EX ,
field of this argument will hold the descriptor of the leased file
that has been accessed by another process.
(This is useful if the caller holds leases against multiple files).
-.SS "File and directory change notification (dnotify)"
+.SS File and directory change notification (dnotify)
.TP
.BR F_NOTIFY " (\fIint\fP)"
(Linux 2.4 onward)
file system events.
See
.BR inotify (7).
-.SS "Changing the capacity of a pipe"
+.SS Changing the capacity of a pipe
.TP
.BR F_SETPIPE_SZ " (\fIint\fP; since Linux 2.6.35)"
Change the capacity of the pipe referred to by
.BR F_GETPIPE_SZ " (\fIvoid\fP; since Linux 2.6.35)"
Return (as the function result) the capacity of the pipe referred to by
.IR fd .
-.SH "RETURN VALUE"
+.SH RETURN VALUE
For a successful call, the return value depends on the operation:
.TP 0.9i
.B F_DUPFD
Attempted to clear the
.B O_APPEND
flag on a file that has the append-only attribute set.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001.
Only the operations
.BR F_DUPFD ,
Similar races exist between mandatory locks and
.BR mmap (2).
It is therefore inadvisable to rely on mandatory locking.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR dup2 (2),
.BR flock (2),
.BR open (2),
.BR lockf (3),
.BR capabilities (7),
.BR feature_test_macros (7)
-.P
-See also
+
.IR locks.txt ,
.IR mandatory-locking.txt ,
and
.I dnotify.txt
-in the kernel source directory
-.IR Documentation/filesystems/ .
-(On older kernels, these files are directly under the
+in the Linux kernel source directory
+.IR Documentation/filesystems/
+(on older kernels, these files are directly under the
.I Documentation/
directory, and
.I mandatory-locking.txt
is called
-.IR mandatory.txt .)
+.IR mandatory.txt )