.\" Copyright (c) 1983 The Regents of the University of California.
.\" %sccs.include.redist.man%
.\" @(#)fcntl.2 8.1 (Berkeley) %G%
.Fn fcntl "int fd" "int cmd" "int arg"
provides for control over descriptors.
is a descriptor to be operated on by
.Bl -tag -width F_GETOWNX
Return a new descriptor as follows:
.Bl -bullet -compact -offset 4n
Lowest numbered available descriptor greater than or equal to
Same object references as the original descriptor.
New descriptor shares the same file offset if the object
Same access mode (read, write or read/write).
Same file status flags (i.e., both file descriptors
share the same file status flags).
The close-on-exec flag associated with the new file descriptor
is set to remain open across
Get the close-on-exec flag associated with the file descriptor
If the low-order bit of the returned value is 0,
the file will remain open across
otherwise the file will be closed upon execution of
Set the close-on-exec flag associated with
Get descriptor status flags, as described below
Set descriptor status flags to
Get the process ID or process group
signals; process groups are returned
Set the process or process group
process groups are specified by supplying
is interpreted as a process ID.
.Bl -tag -width F_GETOWNX
Non-blocking I/O; if no data is available to a
the read or write call returns -1 with the error
Force each write to append at the end of file;
signal to be sent to the process group
when I/O is possible, e.g.,
upon availability of data to be read.
Upon successful completion, the value returned depends on
.Bl -tag -width F_GETOWNX -offset indent
Value of flag (only the low-order bit is defined).
Value of file descriptor owner.
Otherwise, a value of -1 is returned and
is set to indicate the error.
is not a valid open file descriptor.
and the maximum allowed number of file descriptors are currently
is negative or greater than the maximum allowable number
the process ID given as argument is not in use.
The asynchronous I/O facilities of
are currently available only for tty and socket operations.
function call appeared in