#define INTERNAL_SYSCALL_MAIN_0(name, err, args...) \ INTERNAL_SYSCALL_MAIN_INLINE(name, err, 0, args) #define INTERNAL_SYSCALL_MAIN_1(name, err, args...) \ INTERNAL_SYSCALL_MAIN_INLINE(name, err, 1, args) #define INTERNAL_SYSCALL_MAIN_2(name, err, args...) \ INTERNAL_SYSCALL_...
#define SYS_fork __NR_fork #define SYS_fremovexattr __NR_fremovexattr #define SYS_fsetxattr __NR_fsetxattr #define SYS_fstat __NR_fstat #define SYS_fstatfs __NR_fstatfs #define SYS_fsync __NR_fsync #define SYS_ftruncate __NR_ftruncate #define SYS_futex __NR_futex #define SYS_futimes...
#define SYS_flock __NR_flock #define SYS_fork __NR_fork #define SYS_fremovexattr __NR_fremovexattr #define SYS_fsetxattr __NR_fsetxattr #define SYS_fstat __NR_fstat #define SYS_fstatfs __NR_fstatfs #define SYS_fsync __NR_fsync #define SYS_ftruncate __NR_ftruncate #define SYS_futex ...
#define __NR_rt_tgsigqueueinfo(__NR_SYSCALL_BASE+363) #define __NR_perf_event_open(__NR_SYSCALL_BASE+364) 系统调用的功能: 主要分为3大类: (1)进程控制类 fork 创建一个子进程 clone 按照指定条件创建子进程 execve 运行可执行文件 ... (2)文件控制操作 fcntl 文件控制 open 打开文件 read 读...
// System call numbers #define SYS_fork 1 #define SYS_exit 2 #define SYS_wait 3 #define SYS_pipe 4 ... 简单来说:添加一个系统调用的步骤是: 在user/user.h文件中定义系统调用的函数接口 在user/user.pl脚本中添加entry() 在syscall.h文件中,添加系统调用号用来索引 除了添加,还需要对系统调用进行...
#include <sys/syscall.h>#define gettid() syscall(__NR_gettid) 但是依旧不能使用syscall()函数, 检查源码后: sys/syscall.h内部表示,他封装了 打开对应的syscall.h文件内部依旧没有syscall()函数的声明。 如上所言,内部是一些宏定义。 至此问题明确为:缺少对应的syscall()的声明。
244 #define __NR_fremovexattr 237 245 #define __NR_mysyscall 238 /* mysyscall adds here */ 添加系统调用号之后,系统才能根据这个号,作为索引,去找syscall_table中的相应表项。 所以说,我们接下来的一步就是: 四、在系统调用表中添加相应表项 ...
#define _LINUX_SYSCALLS_H structepoll_event; structiattr; structinode; structiocb; structio_event; structiovec; structitimerspec; structitimerval; structkexec_segment; structlinux_dirent; structlinux_dirent64; structlist_head; structmmap_arg_struct; ...
/* System call table for i386. */#include<linux/linkage.h>#include<linux/sys.h>#include<linux/cache.h>#include<asm/asm-offsets.h>#include<asm/syscall.h>#define__SYSCALL_I386(nr,sym,qual)extern asmlinkage longsym(unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned...
(__NR_clone, stub_clone)#define__NR_fork 57__SYSCALL(__NR_fork, stub_fork)#define__NR_vfork 58__SYSCALL(__NR_vfork, stub_vfork)#define__NR_execve 59__SYSCALL(__NR_execve, stub_execve)#define__NR_sigaltstack 131__SYSCALL(__NR_sigaltstack, stub_sigaltstack)#define__NR_iopl 172_...