FCNTL(7) — UNIX 3.0
NAME
fcntl − file control options
SYNOPSIS
#include <fcntl.h>
DESCRIPTION
The fcntl(2) function provides for control over open files. This include file describes requests and arguments to fcntl and open(2).
/* Flag values accessible to open(2) and fcntl(2) */
/* (The first three can only be set by open) */
#defineO_RDONLY 0
#defineO_WRONLY 1
#defineO_RDWR 2
#defineO_NDELAY 04 /* Non-blocking I/O */
#defineO_APPEND 010 /* append (writes guaranteed at the end) */
/* Flag values accessible only to open(2) */
#defineO_CREAT 00400 /* open with file create (uses third open arg)*/
#defineO_TRUNC 01000 /* open with truncation */
#defineO_EXCL 02000 /* exclusive open */
/* fcntl(2) requests */
#defineF_DUPFD 0 /* Duplicate fildes */
#defineF_GETFD 1 /* Get fildes flags */
#defineF_SETFD 2 /* Set fildes flags */
#defineF_GETFL 3 /* Get file flags */
#defineF_SETFL 4 /* Set file flags */
SEE ALSO
May 16, 1980