FCNTL.H(3HEAD) | Headers | FCNTL.H(3HEAD) |
fcntl.h, fcntl - file control options
#include <fcntl.h>
The <fcntl.h> header defines the following requests and arguments for use by the functions fcntl(2), open(2), and openat(2).
Values for cmd used by fcntl() (the following values are unique):
F_DUPFD
F_DUP2FD
F_GETFD
F_SETFD
F_GETFL
F_SETFL
F_GETOWN
F_SETOWN
F_FREESP
F_ALLOCSP
F_ALLOCSP64
F_GETLK
F_GETLK64
F_SETLK
F_SETLK64
F_SETLKW
F_SETLKW64
F_SHARE
F_UNSHARE
File descriptor flags used for fcntl():
FD_CLOEXEC
Values for l_type used for record locking with fcntl() (the following values are unique):
F_RDLCK
F_UNLCK
F_WRLCK
Values for f_access used for share reservations with fcntl() (the following values are unique):
F_RDACC
F_WRACC
F_RWACC
Values for f_deny used for share reservations with fcntl() (the following values are unique):
F_COMPAT
F_RDDNY
F_WRDNY
F_RWDNY
F_NODNY
File creation and assignment flags are used in the oflag argument by open() and openat(). All of these values are bitwise distinct:
O_CREAT
O_DIRECTORY
O_EXCL
O_NOCTTY
O_TRUNC
O_XATTR
File status flags used for fcntl(), open(), and open():
O_APPEND
O_CLOEXEC
O_NDELAY
O_NONBLOCK
O_DSYNC
O_RSYNC
O_SYNC
Mask for use with file access modes:
O_ACCMODE
File access modes used for fcntl(), open(), and openat():
O_RDONLY
O_RDWR
O_WRONLY
The following constants are used by system calls capable of resolving paths relative to a provided open file descriptor:
AT_FDCWD
AT_SYMLINK_NOFOLLOW
AT_REMOVEDIR
The flock structure describes a file lock. It includes the following members:
short l_type; /* Type of lock */ short l_whence; /* Flag for starting offset */ off_t l_start; /* Relative offset in bytes */ off_t l_len; /* Size; if 0 then until EOF */ long l_sysid; /* Returned with F_GETLK */ pid_t l_pid; /* Returned with F_GETLK */
The structure fshare describes a file share reservation. It includes the following members:
short f_access; /* Type of reservation */ short f_deny; /* Type of reservations to deny */ long f_id; /* Process unique identifier */
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Committed |
Standard | See standards(7). |
creat(2), exec(2), fcntl(2), open(2), fdatasync(3C), fsync(3C), attributes(7), fsattr(7), standards(7)
Data is successfully transferred for a write operation to a regular file when the system ensures that all data written is readable on any subsequent open of the file (even one that follows a system or power failure) in the absence of a failure of the physical storage medium.
Data is successfully transferred for a read operation when an image of the data on the physical storage medium is available to the requesting process.
Synchronized I/O data integrity completion (see fdatasync(3C)):
File attributes that are not necessary for data retrieval (access time, modification time, status change time) need not be successfully transferred prior to returning to the calling process.
Synchronized I/O file integrity completion (see fsync(3C)):
January 20, 2020 | OmniOS |