c - 如何根据文件unistd_64.h或unistd_32.h中的编号输出系统调用的名称?

标签 c linux-kernel system-calls unistd.h

例如unistd_64.h中有一些宏

...

#define __NR_semget 64

#define __NR_semop 65

#define __NR_semctl 66

#define __NR_shmdt 67

#define __NR_msgget 68

#define __NR_msgsnd 69

...

当我输入数字时

64

,将会输出

__NR_semget 或 semget

c/cpp源代码更好,谢谢!

最佳答案

系统调用名称和编号映射很大程度上取决于您所使用的体系结构。

ausyscall - 提供给定系统调用号的映射。也许你可以这样做:

system("ausyscall 64 x86_64")

这应该返回semget

关于c - 如何根据文件unistd_64.h或unistd_32.h中的编号输出系统调用的名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24924313/

相关文章:

c - OpenGL - 着色器,符号在 v. 和 f. 中用 2 种不同的类型定义。着色器

计算输入中的字符

c - Linux内核模块构建中的特定宏值

linux - getpwnam 是否尊重/etc/nsswitch.conf?

c - 将中断请求扩展到其他处理器

c - 查找 FAT32 文件系统上主引导记录数据的根目录偏移量

c - 为 makefiles/kconfig 中的变量赋值

linux - Wind River Linux,失败的依赖错误

c - system() 调用行为

linux - 在 ARM-OABI 上实现 syscall()。什么是 "svc#0x900071"?