例如 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源代码好多了,谢谢!
例如 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源代码好多了,谢谢!
一种方法是定义一个表示这些定义名称的字符串数组。不幸的是,没有捷径可走……
const char *name[] = {
...,
/* this is now the 64th string... */
"__NR_semget",
"__NR_semop",
...
};
printf("name: %s\n", name[64]);
系统调用名称和号码映射很大程度上取决于您使用的架构。
ausyscall - 提供给定系统调用号的映射。也许您可以执行以下操作:
system("ausyscall 64 x86_64")
这应该返回semget