FCNTL(5) — Stardent Computer Inc.
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_RDONLY0
#defineO_WRONLY1
#defineO_RDWR2
#defineO_NDELAY04/∗ Non-blocking I/O ∗/
#defineO_APPEND010/∗ append (writes guaranteed at the end) ∗/
#defineO_SYNC020/∗ synchronous write option ∗/
/∗ Flag values accessible only to open(2) ∗/
#defineO_CREAT00400/∗ open with file create (uses third open arg)∗/
#defineO_TRUNC01000/∗ open with truncation ∗/
#defineO_EXCL02000/∗ exclusive open ∗/
/∗ fcntl(2) requests ∗/
#defineF_DUPFD0/∗ Duplicate fildes ∗/
#defineF_GETFD1/∗ Get fildes flags ∗/
#defineF_SETFD2/∗ Set fildes flags ∗/
#defineF_GETFL3/∗ Get file flags ∗/
#defineF_SETFL4/∗ Set file flags ∗/
#defineF_GETLK5/∗ Get file lock ∗/
#defineF_SETLK6/∗ Set file lock ∗/
#defineF_SETLKW7/∗ Set file lock and wait ∗/
#defineF_CHKFL8/∗ Check legality of file flag changes ∗/
/∗ file segment locking control structure ∗/
struct flock {
shortl_type;
shortl_whence;
longl_start;
longl_len;/∗ if 0 then until EOF ∗/
shortl_sysid;/∗ returned with F_GETLK∗/
shortl_pid;/∗ returned with F_GETLK∗/
}
/∗ file segment locking types ∗/
#defineF_RDLCK01/∗ Read lock ∗/
#defineF_WRLCK02/∗ Write lock ∗/
#defineF_UNLCK03/∗ Remove locks ∗/
SEE ALSO
September 29, 2021