open怎么在unistd.h头文件中找不到对应的__NR_open系统调用号?
今天下了个2.6.37内核,本来向看看open()函数在设备驱动使用中要经过那么途径最终调用struct file_operation结构体里的.open 函数的。但是,我在这个2.6.37内核工程里没有找到
open(const char* filename,int flags,mode_t mode)
而且在unistd.h也找不到__NR_open系统调用号
open(const char* filename,int flags,mode_t mode)
而且在unistd.h也找不到__NR_open系统调用号
作者: shaohui973 发布时间: 2011-01-27
参考一下这个帖子:
http://linux.chinaunix.net/bbs/thread-1177485-1-1.html
高版本的定义方式发生了变化
http://linux.chinaunix.net/bbs/thread-1177485-1-1.html
高版本的定义方式发生了变化
作者: Godbach 发布时间: 2011-01-28
我在2.6.36里面的 include/asm-generic/unistd.h 看到:
662 #define __NR_open 1024
663 __SYSCALL(__NR_open, sys_open)
难道37的没有?
662 #define __NR_open 1024
663 __SYSCALL(__NR_open, sys_open)
难道37的没有?
作者: amarant 发布时间: 2011-01-28
2.6.37 中的
不过这个定义是在条件宏 #ifdef __ARCH_WANT_SYSCALL_NO_AT 成立的条件下
QUOTE:
653 /*
654 * All syscalls below here should go away really,
655 * these are provided for both review and as a porting
656 * help for the C library version.
657 *
658 * Last chance: are any of these important enough to
659 * enable by default?
660 */
661 #ifdef __ARCH_WANT_SYSCALL_NO_AT
662 #define __NR_open 1024
663 __SYSCALL(__NR_open, sys_open)
664 #define __NR_link 1025
665 __SYSCALL(__NR_link, sys_link)
654 * All syscalls below here should go away really,
655 * these are provided for both review and as a porting
656 * help for the C library version.
657 *
658 * Last chance: are any of these important enough to
659 * enable by default?
660 */
661 #ifdef __ARCH_WANT_SYSCALL_NO_AT
662 #define __NR_open 1024
663 __SYSCALL(__NR_open, sys_open)
664 #define __NR_link 1025
665 __SYSCALL(__NR_link, sys_link)
不过这个定义是在条件宏 #ifdef __ARCH_WANT_SYSCALL_NO_AT 成立的条件下
作者: Godbach 发布时间: 2011-01-28