HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)
f
fcntl(2) fcntl(2)
F_UNSHARE Value other than −1.
Otherwise, a value of −1 is returned and
errno is set to indicate the error.
ERRORS
fcntl() fails if any of the following conditions occur:
[EACCES] cmd is F_SETLK, the type of lock (
l_type) is a read lock ( F_RDLCK ) or write
lock (
F_WRLCK ) and the segment of a file to be locked is already write-locked by
another process, or the type is a write lock (
F_WRLCK ) and the segment of a file
to be locked is already read- or write-locked by another process.
[EAGAIN] cmd is
F_SETLK or F_SETLKW , and the file is mapped in to virtual memory via
the mmap() system call (see mmap(2)).
[EAGAIN] cmd is F_SHARE and f_access conflicts with an existing
f_deny share
reservation.
[EAGAIN] cmd is
F_SETOPLOCK , and this request conflicts with an existing byte lock or
share reservation.
[EBADF] fildes is not a valid open file descriptor, or was not opened for reading when set-
ting a read lock, or for writing when setting a write lock.
[EBADF] cmd arg is F_SHARE, and the f_access share reservation is for read or write
access, and the file descriptor is not a valid file descriptor open for reading.
[EDEADLK] cmd is F_SETLKW, when the lock is blocked by a lock from another process and
sleeping (waiting) for that lock to become free. This causes a deadlock situation.
[EFAULT] cmd is either F_GETLK, F_SETLK,orF_SETLKW
, and arg points to an illegal
address.
[EFAULT] cmd is either
F_SHARE or F_UNSHARE , and arg points to an illegal address.
[EFAULT] cmd is either
F_SETOPLOCK , F_SETOPLOCKW , F_HAVEOPLOCK ,or
F_REMOVEOPLOCK, and arg points to an illegal address.
[EINTR] cmd is
F_SETLKW and the call was interrupted by a signal.
[EINVAL] cmd is F_DUPFD and arg is negative.
[EINVAL] cmd is F_GETLK, F_SETLK,orF_SETLKW
, and arg or the data it points to is
not valid, or fildes refers to a file that does not support locking.
[EINVAL] cmd is not a valid command.
[EINVAL] cmd is
F_SETFL and both O_NONBLOCK and O_NDELAY
are specified.
[EINVAL] cmd is
F_SETOPLOCK or F_SETOPLOCKW and the o_type
, o_timeout,or
o_retry values are not valid.
[EINVAL] cmd is F_SHARE or F_UNSHARE and arg is invalid.
[EINVAL] cmd is
F_DUPFD and arg is greater than or equal to the maximum number of
file descriptors.
[EMFILE] cmd is
F_DUPFD and the maximum number of file descriptors is currently
open.
[ENOLCK] cmd is F_SETLK or F_SETLKW, the type of lock is a read or write lock, and no
more record locks are available (too many file segments locked).
[ENOLCK] cmd is F_SETLK or F_SETLKW, the type of lock (l_type) is a read lock
(F_RDLCK ) or write lock ( F_WRLCK ) and the file is an NFS file with access bits
set for enforcement mode.
[ENOLCK] cmd is F_GETLK, F_SETLK,orF_SETLKW, the file is an NFS file, and a sys-
tem error occurred on the remote node.
[ENOSYS] [ENOSYS] cmd is F_SETOPLOCK or F_SETOPLOCKW and the arg is
VFS_OPLOCK_FILTER which is currently defined but not supported.
[ENOTSOCK] cmd is F_GETOWN or F_SETOWN, and fildes does not refer to a socket.
108 Hewlett-Packard Company − 6 − HP-UX 11i Version 3: February 2007