Defines file control options.
The /usr/include/fcntl.h file defines the values that can be specified for the Command and Argument parameters of the fcntl subroutine and for the Oflag parameter of the open subroutine. The file-status flags of an open file are described in the following information.
The following flag values are accessible only to the open subroutine:
The O_ACCMODE mask is used to determine the file access mode.
The following file status flags are accessible to both the open and fcntl subroutines:
O_NONBLOCK | POSIX nonblocking I/O |
FNONBLOCK | POSIX nonblocking I/O |
O_APPEND | An append with writes guaranteed at the end |
FAPPEND | An append with writes guaranteed at the end |
O_SYNC | Synchronous write option |
FSYNC | Synchronous write option |
O_DSYNC | Synchronous write option (file data only). |
FDATASYNC | Synchronous write option (file data only). |
O_RSYNC | Synchronous file attributes on read. |
FREADSYNC | Synchronous file attributes on read. |
FASYNC | Asynchronous I/O |
O_NDELAY | Nonblocking I/O |
FNDELAY | Nonblocking I/O |
O_LARGEFILE | Access to large files enabled . |
The following file status flags are accessible to the open subroutine:
O_DEFER | Deferred update |
O_DELAY | Open with delay |
O_DIRECT | Open for Direct I/O |
The following file descriptor flag is accessible to the fcntl subroutine:
FD_CLOEXEC | Close this file during an exec. |
File flag values corresponding to file access modes are as follows:
FREAD | File is open for read. |
FWRITE | File is open for write. |
The Command values for the fcntl subroutine (that is, for fcntl subroutine requests) are:
F_DUPFD | Duplicate the file description. |
F_GETFD | Get the file description flags. |
F_SETFD | Set the file description flags. |
F_GETFL | Get the file status flags and file access modes. |
F_SETFL | Set the file flags. |
F_GETLK | Return information about an existing file lock. |
F_GETLK64 | Return information about an existing file lock. |
F_SETLK | Set or clear a file lock. |
F_SETLK64 | Set or clear a file lock. |
F_SETLKW | Set or clear a file lock and wait if blocked. |
F_SETLKW64 | Set or clear a file lock and wait if blocked. |
F_GETOWN | Get the descriptor owner. |
F_SETOWN | Set the descriptor owner. |
The fcntl subroutine, open, openx, or creat subroutine.
The sys/types.h file, unistd.h file.
The Header Files Overview defines header files, describes how they are used, and lists several header files for which information is provided.