123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- #ifndef _FCNTL_H
- # error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
- #endif
- #include <sys/types.h>
- #ifdef __USE_GNU
- # include <bits/uio.h>
- #endif
- #define O_ACCMODE 0003
- #define O_RDONLY 00
- #define O_WRONLY 01
- #define O_RDWR 02
- #define O_CREAT 0100
- #define O_EXCL 0200
- #define O_NOCTTY 0400
- #define O_TRUNC 01000
- #define O_APPEND 02000
- #define O_NONBLOCK 04000
- #define O_NDELAY O_NONBLOCK
- #define O_SYNC 010000
- #define O_FSYNC O_SYNC
- #define O_ASYNC 020000
- #ifdef __USE_XOPEN2K8
- # define O_DIRECTORY 0200000
- # define O_NOFOLLOW 0400000
- # define O_CLOEXEC 02000000
- #endif
- #ifdef __USE_GNU
- # define O_DIRECT 040000
- # define O_NOATIME 01000000
- # define O_PATH 010000000
- # define O_TMPFILE 020200000
- #endif
- #if defined __USE_POSIX199309 || defined __USE_UNIX98
- # define O_DSYNC O_SYNC
- # define O_RSYNC O_SYNC
- #endif
- #ifdef __USE_LARGEFILE64
- # define O_LARGEFILE 0100000
- #endif
- #define F_DUPFD 0
- #define F_GETFD 1
- #define F_SETFD 2
- #define F_GETFL 3
- #define F_SETFL 4
- #ifndef __USE_FILE_OFFSET64
- # define F_GETLK 5
- # define F_SETLK 6
- # define F_SETLKW 7
- #else
- # define F_GETLK F_GETLK64
- # define F_SETLK F_SETLK64
- # define F_SETLKW F_SETLKW64
- #endif
- #define F_GETLK64 12
- #define F_SETLK64 13
- #define F_SETLKW64 14
- #if defined __USE_BSD || defined __USE_UNIX98
- # define F_SETOWN 8
- # define F_GETOWN 9
- #endif
- #ifdef __USE_GNU
- # define F_SETSIG 10
- # define F_GETSIG 11
- #endif
- #ifdef __USE_GNU
- # define F_SETLEASE 1024
- # define F_GETLEASE 1025
- # define F_NOTIFY 1026
- # define F_SETPIPE_SZ 1031
- # define F_GETPIPE_SZ 1032
- #endif
- #if defined __USE_XOPEN2K8 || defined __USE_GNU
- # define F_DUPFD_CLOEXEC 1030
- #endif
- #define FD_CLOEXEC 1
- #define F_RDLCK 0
- #define F_WRLCK 1
- #define F_UNLCK 2
- #define F_EXLCK 4
- #define F_SHLCK 8
- #ifdef __USE_BSD
- # define LOCK_SH 1
- # define LOCK_EX 2
- # define LOCK_NB 4
- # define LOCK_UN 8
- #endif
- #ifdef __USE_GNU
- # define LOCK_MAND 32
- # define LOCK_READ 64
- # define LOCK_WRITE 128
- # define LOCK_RW 192
- #endif
- #ifdef __USE_GNU
- # define DN_ACCESS 0x00000001
- # define DN_MODIFY 0x00000002
- # define DN_CREATE 0x00000004
- # define DN_DELETE 0x00000008
- # define DN_RENAME 0x00000010
- # define DN_ATTRIB 0x00000020
- # define DN_MULTISHOT 0x80000000
- #endif
- struct flock
- {
- short int l_type;
- short int l_whence;
- #ifndef __USE_FILE_OFFSET64
- __off_t l_start;
- __off_t l_len;
- #else
- __off64_t l_start;
- __off64_t l_len;
- #endif
- __pid_t l_pid;
- };
- #ifdef __USE_LARGEFILE64
- struct flock64
- {
- short int l_type;
- short int l_whence;
- __off64_t l_start;
- __off64_t l_len;
- __pid_t l_pid;
- };
- #endif
- #ifdef __USE_BSD
- # define FAPPEND O_APPEND
- # define FFSYNC O_FSYNC
- # define FASYNC O_ASYNC
- # define FNONBLOCK O_NONBLOCK
- # define FNDELAY O_NDELAY
- #endif
- #ifdef __USE_XOPEN2K
- # define POSIX_FADV_NORMAL 0
- # define POSIX_FADV_RANDOM 1
- # define POSIX_FADV_SEQUENTIAL 2
- # define POSIX_FADV_WILLNEED 3
- # define POSIX_FADV_DONTNEED 4
- # define POSIX_FADV_NOREUSE 5
- #endif
- #if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
- # define SYNC_FILE_RANGE_WAIT_BEFORE 1
- # define SYNC_FILE_RANGE_WRITE 2
- # define SYNC_FILE_RANGE_WAIT_AFTER 4
- # define SPLICE_F_MOVE 1
- # define SPLICE_F_NONBLOCK 2
- # define SPLICE_F_MORE 4
- # define SPLICE_F_GIFT 8
- #endif
- __BEGIN_DECLS
- #if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
- extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
- __THROW;
- extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
- unsigned int __flags);
- extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
- size_t __count, unsigned int __flags);
- extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
- __off64_t *__offout, size_t __len,
- unsigned int __flags);
- extern ssize_t tee (int __fdin, int __fdout, size_t __len,
- unsigned int __flags);
- #endif
- __END_DECLS
- #include <bits/fcntl-linux.h>
|