c - execve() 传递的未知 open() 标志

标签 c linux fuse strace

当执行位于我的 FUSE 文件系统上的 bash 脚本时,使用这些标志进行 open() 调用:

debug,cpfsfuse.c(62),cpfs_fuse_open: path "/make.sh", flags 0100040

The flags (0100040) should correspond to those passed in parameter 2 of open(). The unknown flag originates from an execve() call:

matt@stanley:~/cpfs/dir$ strace -f ./make.sh 
execve("./make.sh", ["./make.sh"], [/* 37 vars */]

我的代码识别#define O_LARGEFILE 00100000,但另一个标志似乎仅在调用 execve() 时出现。

Grepping for flag 没有找到它:

matt@stanley:~/cpfs$ grep -RP '\b00*40\b' /usr/include/ | less

大多数终端标志被发现。任何人都可以阐明如何追查这面旗帜的起源和意义,或者在哪里可以找到它的定义吗?

最佳答案

/usr/include/linux/fs.h:

/* File is opened for execution with sys_execve / sys_uselib */
#define FMODE_EXEC              ((fmode_t)32)

关于c - execve() 传递的未知 open() 标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3657003/

相关文章:

c - 一个动画处理图标,纯C

AWS 上的 Python 网络抓取脚本在 1.5 小时/获取 10,000 个 xml 后一直失败

bash - 无法删除 .git : Directory not empty

macos - 如何使用 sshfs 在我的 Mac 上安装远程驱动器 (BeagleBone)?

c++ - 难以理解 free() 的行为

c - 我可以使用比我用 malloc() 分配的内存更多的内存,为什么?

Python - 我怎样才能让客户端能够多次连接?

linux - 使用 INADDR_ANY 更改 udp 服务器绑定(bind)的默认源 IP

linux - 为大型目录添加 I/O Hook

c - WM_SIZE 消息是否被发送到消息队列?