Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) spt_fcntlx(2)
The O_ASYNC flag is not supported for sockets. If the O_ASYNC flag is used
with F_SETFL, the fcntl( ) call fails, and errno is set to [EINVAL].
The file 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 specifies anything other than a socket
for the filedes 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 specified 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 specifies anything other than a socket
for the filedes 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
files. Advisory record locking is supported only for regular files. If attempted on other files, the
operation fails, and errno is set to [EINVAL].
F_GETLK Gets the first 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 flock 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 file 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 file status flag affects only operations against file descriptors derived from
the same open() function.
When a shared lock is set on a segment of a file, 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 file descriptor is not
527186-023 Hewlett-Packard Company 7−161