The operating modes affect how input and output operations using a file descriptor work. These flags are set by open
and can be fetched and changed with fcntl
.
write
operations write the data at the end of the file, extending it, regardless of the current file position.
read
requests on the file can return immediately with a failure status if there is no input immediately available, instead of blocking. Likewise, write
requests can also return immediately with a failure status if the output can't be written immediately.
Note that the O_NONBLOCK
flag is overloaded as both an I/O operating mode and a file name translation flag; see Open-time Flags.
O_NONBLOCK
, provided for compatibility with BSD. It is not defined by the POSIX.1 standard. The remaining operating modes are BSD and GNU extensions. They exist only on some systems. On other systems, these macros are not defined.
SIGIO
signals will be generated when input is available. See Interrupt Input. Asynchronous input mode is a BSD feature.
write
call will make sure the data is reliably stored on disk before returning. Synchronous writing is a BSD feature.
O_FSYNC
. They have the same value.
read
will not update the access time of the file. See File Times. This is used by programs that do backups, so that backing a file up does not count as reading it. This is a GNU extension.