繁体   English   中英

为什么linux中有多个fcntl.h?

[英]why are there multiple fcntl.h in linux?

我写了包含fcntl.h文件的ac程序。 我搜索文件并获得如下结果:

[xunyl@localhost csapp]$ find /usr/include/ -name "fcntl.h"
/usr/include/asm/fcntl.h
/usr/include/asm-generic/fcntl.h
/usr/include/linux/fcntl.h
/usr/include/sys/fcntl.h
/usr/include/bits/fcntl.h
/usr/include/fcntl.h

[xunyl@localhost csapp]$ grep -rn "O_RDONLY" /usr/include/
/usr/include/asm-generic/fcntl.h:19:#define O_RDONLY    00000000
/usr/include/linux/cdrom.h:32: *       -    drive = open("/dev/cdrom", O_RDONLY);
/usr/include/linux/cdrom.h:33: *       +    drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
...

当我在程序中放入#include <fcntl.h>时,我发现gcc调用了/usr/include/asm-generic/fcntl.h 我只是想知道gcc如何确定应该调用哪个“fcntl.h”。 是否有任何电话订单或优先顺序?

一个包括另一个包括下一个,直到包含定义的那个。

暂无
暂无

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

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