FCNTL.H(7,F) AIX Technical Reference FCNTL.H(7,F)
-------------------------------------------------------------------------------
fcntl.h
PURPOSE
Defines file control options.
SYNOPSIS
#include <fcntl.h>
DESCRIPTION
The fcntl.h header file defines the values that can be specified for the cmd
and arg parameters of the fcntl system call, and for the oflag parameter of the
open system call.
/* Flag values accessible to open and fcntl */
/* The first three can only be set by open */
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_NDELAY 04 /* Non-blocking I/O */
#define O_APPEND 010 /* (0x08) append (writes guaranteed */
/* at the end) */
#define O_SYNC 0200000 /* Synchronous write */
#define O_REPLSYNC 0400000 /* Synchronous replicated write */
/* Flag values accessible only to fcntl */
#define O_ASYNC 020 /* (0x10) signal pgrp when data ready */
/* Flag values accessible only to open */
#define O_DEFERC 00040 /* (0x0020) delay commits of changes */
#define O_EDELAY 00100 /*Return EAGAIN if block would have occurred*/
#define O_NONBLOCK (O_NDELAY | O_EDELAY) /* POSIX compatibility */
#define O_CREAT 00400 /* (0x0100) open with create (uses third */
/* open arg) */
#define O_TRUNC 01000 /* (0x0200) open with truncation */
#define O_EXCL 02000 /* (0x0400) exclusive open */
/* fcntl requests */
#define F_DUPFD 0 /* Duplicate fildes */
#define F_GETFD 1 /* Get fildes flags */
#define F_SETFD 2 /* Set fildes flags */
#define F_GETFL 3 /* Get file flags */
#define F_SETFL 4 /* Set file flags */
#define F_GETLK 5 /* Get file lock */
#define F_SETLK 6 /* Set file lock */
#define F_SETLKW 7 /* Set file lock and wait */
Processed November 7, 1990 FCNTL.H(7,F) 1
FCNTL.H(7,F) AIX Technical Reference FCNTL.H(7,F)
#define F_GETOWN 9 /* get pgrp */
#define F_SETOWN 10 /* set pgrp for SIGIO */
/* file segment locking set data type - information passed to */
/* system by user */
struct flock {
short l_type;
short l_whence;
long l_start;
long l_len; /* len = 0 means until end of file */
unsigned long l_sysid;
pid_t l_pid;
};
/* file segment locking types */
#define F_RDLCK 01 /* Read lock */
#define F_WRLCK 02 /* Write lock */
#define F_UNLCK 03 /* Remove lock(s) */
FILE
/usr/include/fcntl.h
RELATED INFORMATION
In this book: "fcntl, flock, lockf" and "open, openx, creat."
Processed November 7, 1990 FCNTL.H(7,F) 2