- 论坛徽章:
- 0
|
没仔细看吧:
/* Get the definitions of O_*, F_*, FD_*: all the
numbers and flag bits for `open', `fcntl', et al. */
#include <bits/fcntl.h>
以上内容是在fcntl.h里发现的。就是说,fcntl.h包含了bits/fcntl.h
头文件包含另一个头文件
O_XXXX系列的定义在:
/usr/include/bits/fcntl.h中
而
/usr/include/fcntl.h包含了/usr/include/bits/fcntl.h
bits/fcntl.h的部分内容:
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#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 010000
#define O_FSYNC O_SYNC
#define O_ASYNC 020000 |
|