Open System Services System Calls Reference Manual (G06.28+)

System Functions (f - i) fcntl(2)
The le access mode is not changed when F_SETFL is used.
F_GETOWN Gets the process ID or process group ID currently receiving the SIGURG signal
for a socket. A process group ID is returned as a negative value. A positive
value indicates the process ID.
The value F_GETOWN is invalid for these calls:
Guardian use of OSS sockets is not supported. If this value is used in a
call from the Guardian environment, the call fails, and errno is set to
[ENOTOSS].
If this value is used in a call that species anything other than a socket
for the ledes parameter, the call fails, and errno is set to [EINVAL].
F_SETOWN Sets the process ID or process group ID to receive the SIGURG signal for a
socket. A process group ID is specied by supplying it as a negative value in the
argument1 parameter; otherwise, the argument1 parameter is interpreted as a
process ID.
The value F_SETOWN is invalid for these calls:
Guardian use of OSS sockets is not supported. If this value is used in a
call from the Guardian environment, the call fails, and errno is set to
[ENOTOSS].
If this value is used in a call that species anything other than a socket
for the ledes parameter, the call fails, and errno is set to [EINVAL].
These values listed for the request parameter are available for advisory record locking on regular
les. Advisory record locking is supported only for regular les. If attempted on other les, the
operation fails, and errno is set to [EINVAL].
F_GETLK Gets the rst lock that blocks the lock description pointed to by the argument2
parameter. The information retrieved overwrites the information passed to the
fcntl() function in the ock structure. If no lock is found that would prevent this
lock from being created, the structure is left unchanged except for the lock type,
which is set to F_UNLCK.
F_SETLK Sets or clears a le segment lock according to the lock description pointed to by
the argument2 parameter. F_SETLK is used to establish shared locks
(F_RDLCK) or exclusive locks (F_WRLCK) and, additionally, to remove
either type of lock (F_UNLCK). If a shared (read) or exclusive (write) lock can-
not be set, the fcntl( ) function returns immediately with the value -1.
F_SETLKW Same as F_SETLK except that, if a shared or exclusive lock is blocked by other
locks, the process waits until it is unblocked. If a signal is received while fcntl( )
is waiting for a region, the function is interrupted, -1 is returned, and errno is set
to [EINTR].
The O_NONBLOCK le status ag affects only operations against le descriptors derived from
the same open() function.
When a shared lock is set on a segment of a le, other processes can set shared locks on that seg-
ment or a portion of it. A shared lock prevents any other process from setting an exclusive lock
on any portion of the protected area. A request for a shared lock fails if the le descriptor is not
opened with read access.
527186-005 Hewlett-Packard Company 311