fcntl.2 (2011 03)

f
fcntl(2) fcntl(2)
[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.
[EINVAL] cmd is
F_SETFIFOENH then, either fildes is not referring to fifo, or HP’s
optional FIFOENH product is not installed.
[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.
[EOVERFLOW] cmd is
F_GETLK and the blocking lock’s starting offset or length would not fit
in the caller’s structure.
[EPERM] cmd is
F_SETTIMES and the user does not have superuser privilege.
[EWOULDBLOCK] cmd is
F_ADVISE the hint is FADV_WILLNEED and VM has detected a block-
ing condition.
WARNINGS
The oplock support is release specific and as such is not guaranteed to be supported in future releases
and/or with the same interface. HP reserves the right to change or remove oplock support at any time.
If fildes refers to fifo and cmd is set to F_SETFIFOENH then:
1. Major performance improvement can be seen on multiprocessor environment when multiple threads
are operating on the same fifo.
2. There is no visible performance improvement on systems having less than eight CPUs.
3. This particular flag should not be set for synchronous fifo reads or writes which otherwise will cause
performance regression.
If cmd is
F_CLOSEM then:
1. In a multi-threaded application,
F_CLOSEM does not ensure all the file descriptors from fildes are
closed. If any file descriptor is found to be active inside the kernel in a state of being opened or closed
or duped, that file descriptor will not be closed.
HP-UX 11i Version 3: March 2011 7 Hewlett-Packard Company 7