简体   繁体   English

linux中打开arguments的数值

[英]Numerical values of open arguments in linux

I am looking at the linux manual for the open function here but I am not able to find the integer values to the various flags such as O_WRONLY, O_CREAT, O_RDONLY .我在这里查看open function 的 linux 手册,但我无法找到各种标志的 integer 值,例如O_WRONLY, O_CREAT, O_RDONLY Is there a way to find this information?有没有办法找到这些信息?

Here's how I found the definitions:这是我找到定义的方法:

$ find /usr/include -type f -name '*.h' -exec grep -E '^#define.*O_(WRONLY|RDONLY|RDWR)' {} +
/usr/include/asm-generic/fcntl.h:#define O_RDONLY   00000000
/usr/include/asm-generic/fcntl.h:#define O_WRONLY   00000001
/usr/include/asm-generic/fcntl.h:#define O_RDWR     00000002
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:#define O_RDONLY        00
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:#define O_WRONLY        01
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:#define O_RDWR          02

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM