#ifndef SYS_LINUX_FCNTL_H_ #define SYS_LINUX_FCNTL_H_ #include struct flock { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ off_t l_start; /* Offset where the lock begins. */ off_t l_len; /* Size of the locked area; zero means until EOF. */ pid_t l_pid; /* Process holding the lock. */ }; struct flock64 { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ off64_t l_start; /* Offset where the lock begins. */ off64_t l_len; /* Size of the locked area; zero means until EOF. */ pid_t l_pid; /* Process holding the lock. */ }; #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 #define O_RDWR 02 #define O_CREAT 0100 /* Not fcntl. */ #define O_EXCL 0200 /* Not fcntl. */ #define O_NOCTTY 0400 /* Not fcntl. */ #define O_TRUNC 01000 /* Not fcntl. */ #define O_APPEND 02000 #define O_NONBLOCK 04000 #define O_NDELAY O_NONBLOCK #define O_SYNC 04010000 #define O_FSYNC O_SYNC #define O_ASYNC 020000 #define O_LARGEFILE 0100000 #define O_DIRECTORY 0200000 #define O_NOFOLLOW 0400000 #define O_CLOEXEC 02000000 #define O_DIRECT 040000 #define O_NOATIME 01000000 #define O_PATH 010000000 #define O_DSYNC 010000 #define O_TMPFILE (020000000 | __O_DIRECTORY) #define F_GETLK 5 /* Get record locking info. */ #define F_SETLK 6 /* Set record locking info (non-blocking). */ #define F_SETLKW 7 /* Set record locking info (blocking). */ #define F_GETLK64 12 /* Get record locking info. */ #define F_SETLK64 13 /* Set record locking info (non-blocking). */ #define F_SETLKW64 14 /* Set record locking info (blocking). */ #endif