免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 39932 | 回复: 7
打印 上一主题 下一主题

[C] O_RDWR符号常量的定义在哪 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-10 11:00 |只看该作者 |倒序浏览
APUE说在fcntl.h
但是怎么找不到啊.

论坛徽章:
0
2 [报告]
发表于 2007-12-10 11:03 |只看该作者
Linux AS 4

论坛徽章:
0
3 [报告]
发表于 2007-12-10 11:08 |只看该作者
ctags,

论坛徽章:
0
4 [报告]
发表于 2007-12-10 11:11 |只看该作者
没仔细看吧:

/* 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

论坛徽章:
0
5 [报告]
发表于 2007-12-10 11:24 |只看该作者
是没仔细看,只查找了一下...

我知错了

论坛徽章:
0
6 [报告]
发表于 2012-10-11 15:24 |只看该作者
受教了。哈哈。

论坛徽章:
4
水瓶座
日期:2013-09-06 12:27:30摩羯座
日期:2013-09-28 14:07:46处女座
日期:2013-10-24 14:25:01酉鸡
日期:2014-04-07 11:54:15
7 [报告]
发表于 2012-10-12 20:57 |只看该作者
不用找源文件, 学会man fcntl.h.

论坛徽章:
0
8 [报告]
发表于 2013-04-06 11:40 |只看该作者
我的为什么没有啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP