宏: 整数常量O_ACCMODE

3771阅读 0评论2012-03-01 licong0527
分类:LINUX

原文:
Macro: int O_ACCMODE This macro stands for a mask that can be bitwise-ANDed with the file status flag value to produce a value representing the file access mode.
The mode will be O_RDONLY, O_WRONLY, or O_RDWR. (In the GNU system it could also be zero, and it never includes the O_EXEC bit.)

翻译:

          这个宏作为一个掩码以与文件状态标识值做AND位运算,产生一个表示文件访问模式的值。

           这模式将是O_RDONLY, O_WRONLY, 或 O_RDWR(在GNU系统中,也可能是零,并且从不包括 O_EXEC 位)

 

O_ACCMODE<0003>:读写文件操作时,用于取出flag的低2位
O_RDONLY<00>:只读打开
O_WRONLY<01>:只写打开
O_RDWR<02>:读写打开


转载自:http://blog.csdn.net/grasspower/article/details/2807672

上一篇:粘住位 (S_ISVTX)
下一篇:fs与ds寄存器--linux内核