系统调用约定

1、windows 64位调用约定

windows64 位的调用很是奇怪,因为它不是通过栈来传参,而是通过寄存器来传参!

最为常见的是,当参数只有一个的时候,一般是选用rcx来传递参数!

2、Linux 32位调用约定

Linux 32位的系统调用时通过int 80h来实现的,eax寄存器中为调用的功能号,ebx、ecx、edx、esi等等寄存器则依次为参数。下面我们来看看hello world程序:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.section .data
msg:
.ascii "Hello world!\n"
.section .text
.globl _start
_start:
movl $4, %eax
movl $1, %ebx
movl $msg, %ecx
movl $13, %edx
int $0x80
movl $1, %eax
movl $0, %ebx
int $0x80

从 /usr/include/asm/unistd.h中可以看到exit的功能号_NR_exit为1,write(_NR_write)功能号为4,因此第一个int 0x80调用之前eax寄存器值为4,ebx为文件描述符,stdout的文件描述符为1,ecx则为buffer的内存地址,edx为buffer长度。第二个int 0x80之前eax为1表示调用exit,ebx为0表示返回0。

系统调用功能好可以参考System Call Number Definition
以及http://asm.sourceforge.net/syscall.html#2
或者 http://syscalls.kernelgrok.com/ 查找(推荐!)

2.1 系统调用及参数传递过程

这部分具体可以参考:
系统调用及参数传递过程
深入理解Linux的系统调用

我们以x86为例说明:
由于陷入指令是一条特殊指令,而且依赖与操作系统实现的平台,如在x86中,这条指令是int 0x80,这显然不是用户在编程时应该使用的语句,因为这将使得用户程序难于移植。所以在操作系统的上层需要实现一个对应的系统调用库,每个系统调用都在该库中包含了一个入口点(如我们看到的fork, open, close等等),这些函数对程序员是可见的,而这些库函数的工作是以对应系统调用号作为参数,执行陷入指令int 0x80,以陷入核心执行真正的系统调用处理函数。当一个进程调用一个特定的系统调用库的入口点,正如同它调用任何函数一样,对于库函数也要创建一个栈帧。而当进程执行陷入指令时,它将处理机状态转换到核心态,并且在核心栈执行核心代码。

这里给出一个示例(linux/include/asm/unistd.h):

1
2
3
4
5
6
7
8
9
10
#define _syscallN(type, name, type1, arg1, type2, arg2, . . . ) \
type name(type1 arg1,type2 arg2) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2))); \
. . . . . .
__syscall_return(type,__res); \
}

在执行一个系统调用库中定义的系统调用入口函数时,实际执行的是类似如上的一段代码。这里牵涉到一些gcc的嵌入式汇编语言,不做详细的介绍,只简单说明其意义:
其中\_\NR\##name是系统调用号,如name == ioctl,则为\_\_NR\_ioctl,它将被放在寄存器eax中作为参数传递给中断0x80的处理函数。而系统调用的其它参数arg1, arg2, …则依次被放入ebx, ecx, . . .等通用寄存器中,并作为系统调用处理函数的参数,这些参数是怎样传入核心的将会在后面介绍。

注意该调用是从左至右依次传参,与普通函数的由右往左依次传参不同

3、Linux 64位调用约定

现在,我们将要讨论的是64位的系统调用。不过在此之前,我们需要知道linux的两个有关系统调用的重要文件unistd\_32.h和unistd\_64.h,这两个文件定义了系统调用号!

3.1 每种调用号需要传递哪些参数

在linux系统中某个程序执行时进行的系统调用可以通过strace命令来查看,solaris中对应的命令为dtrace,而mac os x中可以通过类似的dtruss命令来查看。当进程已经处于 D 状态(uninterruptible sleep)时,strace 也帮不上忙。这时候可以通过:

cat /proc//syscall

来查看。(详细内容可以到http://www.jb51.net/article/50923.htm查看)

32位的系统调用表的参数可以到 http://syscalls.kernelgrok.com/ 查找;关于32位系统中使用汇编语言调用syscall table,将在另一篇博文[linux下32位汇编的系统调用]中详述。

而在64位系统中,大神说了:可以通过grep在源代码中查找:

To find the implementation of a system call, grep the kernel tree for SYSCALL_DEFINE.\?(syscall,

For example, to find the read system call:

1
2
3
4
5
illusion:/usr/src/linux-source-3.19$ grep -rA3 'SYSCALL_DEFINE.\?(read,' *
fs/read_write.c:SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
fs/read_write.c-{
fs/read_write.c- struct file *file;
fs/read_write.c- ssize_t ret = -EBADF;

也可以在以下网址中查找:
http://blog.rchapman.org/posts/Linux_System_Call_Table_for_x86_64/

3.2 调用如何传递参数以及结果如何返回

在64位linux中,一般来说系统调用的参数统统放在寄存器中,最多可以用到6个寄存器;如果多余6个参数的系统调用怎么传递参数?这个还不清楚,有的文档说64位系统调用的参数最多不会超过6个;还有的文档说超过6个参数的话,其余参数全部通过堆栈来传递。超过6个参数的系统调用,本猫没有实际碰到,也不知到底该怎么办!?就这个问题,有兴趣的童鞋可以和本猫单独切磋讨论。

具体调用规则如下:

  1. 用户模式的系统调用依次传递的寄存器为:

    rdi,rsi,rdx,rcx,r8和r9

  2. 内核接口的系统调用一次传递的寄存器为:

    rdi,rsi,rdx,r10,r8和r9

    注意这里和用户模式的系统调用只有第4个寄存器不同,其他都相同。

  3. 系统调用通过syscall指令进入,不像32位下的汇编使用的是int 0x80指令;

  4. 系统调用号放在rax寄存器里;

  5. 系统调用限制最多6个参数,没有参数直接通过栈传递,原话是:

System-calls are limited to six arguments, no argument is passed directly on the stack

  1. 系统调用的返回结果,也就是syscall指令的返回放在rax寄存器中;
  2. 只有整形值和内存型的值可以传递给内核,这个也不十分明白,原话是:

Only values of class INTEGER or class MEMORY are passed to the kernel

有的童鞋可能要问了,要是浮点数怎么传递给接口!?有参数是浮点数的系统调用吗?这个还真不清楚,不过参数是浮点数的C标准库函数的调用那是大大的有,这个等到在另一篇博文[64汇编调用C标准库函数]中再详细给大家解答。

4、Linux系统调用实例

代码的功能很简单,显示一行文本,然后退出。我们使用了syscall中的write和exit调用,查一下前面的调用号和参数,我们初步总结如下:

write(即sys_write)调用号为1,需传递3个参数

1
2
3
unsigned int fd
const char *buf
size_t count

exit(sys_exit)调用号为60,只需传递一个错误码

1
int error_code

如果该值为0表示程序执行成功。

因为以上两个调用最多的也只有3个参数,所以我们依次只会用到3个寄存器rdi,rsi和rdx。

实际代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
section .text
;if use ld
global _start
;if use gcc
;global main
_start:
;main
mov rax,1 ;write NO
mov rdi,1 ;fd
mov rsi,msg ;addr of msg string
mov rdx,msg_len ;lenght of msg string
syscall
mov rax,60 ;exit NO
mov rdi,0 ;error_code
syscall
msg: db "Hello World!",0xa
msg_len:equ $-msg

编译连接命令如下:

1
2
nasm -f elf64 p.s
ld -o p p.o

如果是mac os x系统下命令如下:

1
2
nasm -f macho64 p.s
ld -o p p.o

如果你要生成32位的代码,在编译时把elf64改为elf32就可以了,不过我前面说过:32位和64位汇编结构变化较大,光改这个是没办法运行成功的。

不出所料代码运行输出一行:Hello World!并且程序返回后用echo $?看,应该为0.

这个例子很简单,下面看一下稍微复杂点的调用:mmap,该调用共有6个参数,我们再一次总结如下:
mmap(sys_mmap) 系统调用号为9,参数分别为:

1
2
3
4
5
6
unsigned long addr
unsigned long len
unsigned long prot
unsigned long flags
unsigned long fd
unsigned long offset

第一个参数是需要映射到的地址,我们这里传0,表示不关心映射到哪;第二个参数是映射空间的大小;第三个参数表示映射区域的保护方式,有很多种,我们这里只让它可读可写即可,所以只用到2者的组合:

PROT_WRITE|PROT_READ

第四个参数是映射区域的一些特性,有很多组合。这里只用MAP_SHARED|MAP_ANONYMOUS,后者表示建立匿名映射,会忽略参数fd,所以不设及文件。

第五个参数就是fd,前面说了可以忽略,所以我们传递-1;最后一个参数是映射的偏移量,我们也传递0.

该调用如果成功返回映射区域内存的起始地址,否则返回MAP_FAILED(-1),错误原因存于errno中,我们可以用strerror(errno)查看具体含义。不过该函数是C库中的,这里我们捎带的用一下。

提到mmap我们不得不提到munmap,用猜大家也知道该调用的含义吧:

munmap(sys_munmap) 调用号为11,需传递2个参数:

1
2
unsigned long start
size_t len

5、函数查询

例如execve的函数查询http://man7.org/linux/man-pages/man2/execve.2.html

6、附录

6.1 32系统调用表

# Name Registers Definition
eax ebx ecx edx esi edi
0 sys_restart_syscall 0x00 - - - - - kernel/signal.c:2058
1 sys_exit 0x01 int error_code - - - - kernel/exit.c:1046
2 sys_fork 0x02 struct pt_regs * - - - - arch/alpha/kernel/entry.S:716
3 sys_read 0x03 unsigned int fd char __user *buf size_t count - - fs/read_write.c:391
4 sys_write 0x04 unsigned int fd const char __user *buf size_t count - - fs/read_write.c:408
5 sys_open 0x05 const char __user *filename int flags int mode - - fs/open.c:900
6 sys_close 0x06 unsigned int fd - - - - fs/open.c:969
7 sys_waitpid 0x07 pid_t pid int __user *stat_addr int options - - kernel/exit.c:1771
8 sys_creat 0x08 const char __user *pathname int mode - - - fs/open.c:933
9 sys_link 0x09 const char __user *oldname const char __user *newname - - - fs/namei.c:2520
10 sys_unlink 0x0a const char __user *pathname - - - - fs/namei.c:2352
11 sys_execve 0x0b char __user * char user *user * char user *user * struct pt_regs * - arch/alpha/kernel/entry.S:925
12 sys_chdir 0x0c const char __user *filename - - - - fs/open.c:361
13 sys_time 0x0d time_t __user *tloc - - - - kernel/posix-timers.c:855
14 sys_mknod 0x0e const char __user *filename int mode unsigned dev - - fs/namei.c:2067
15 sys_chmod 0x0f const char __user *filename mode_t mode - - - fs/open.c:507
16 sys_lchown16 0x10 const char __user *filename old_uid_t user old_gid_t group - - kernel/uid16.c:27
17 not implemented 0x11 - - - - -
18 sys_stat 0x12 char __user *filename struct old_kernel_stat user *statbuf - - - fs/stat.c:150
19 sys_lseek 0x13 unsigned int fd off_t offset unsigned int origin - - fs/read_write.c:167
20 sys_getpid 0x14 - - - - - kernel/timer.c:1337
21 sys_mount 0x15 char __user *dev_name char __user *dir_name char __user *type unsigned long flags void __user *data fs/namespace.c:2118
22 sys_oldumount 0x16 char __user *name - - - - fs/namespace.c:1171
23 sys_setuid16 0x17 old_uid_t uid - - - - kernel/uid16.c:67
24 sys_getuid16 0x18 - - - - - kernel/uid16.c:212
25 sys_stime 0x19 time_t __user *tptr - - - - kernel/time.c:81
26 sys_ptrace 0x1a long request long pid long addr long data - kernel/ptrace.c:688
27 sys_alarm 0x1b unsigned int seconds - - - - kernel/timer.c:1314
28 sys_fstat 0x1c unsigned int fd struct old_kernel_stat user *statbuf - - - fs/stat.c:174
29 sys_pause 0x1d - - - - - kernel/signal.c:2700
30 sys_utime 0x1e char __user *filename struct utimbuf __user *times - - - fs/utimes.c:27
31 not implemented 0x1f - - - - -
32 not implemented 0x20 - - - - -
33 sys_access 0x21 const char __user *filename int mode - - - fs/open.c:356
34 sys_nice 0x22 int increment - - - - kernel/sched.c:4282
35 not implemented 0x23 - - - - -
36 sys_sync 0x24 - - - - - fs/sync.c:98
37 sys_kill 0x25 int pid int sig - - - kernel/signal.c:2317
38 sys_rename 0x26 const char __user *oldname const char __user *newname - - - fs/namei.c:2765
39 sys_mkdir 0x27 const char __user *pathname int mode - - - fs/namei.c:2130
40 sys_rmdir 0x28 const char __user *pathname - - - - fs/namei.c:2244
41 sys_dup 0x29 unsigned int fildes - - - - fs/fcntl.c:131
42 sys_pipe 0x2a int __user *fildes - - - - fs/pipe.c:1117
43 sys_times 0x2b struct tms __user *tbuf - - - - kernel/sys.c:896
44 not implemented 0x2c - - - - -
45 sys_brk 0x2d unsigned long brk - - - - mm/mmap.c:245
46 sys_setgid16 0x2e old_gid_t gid - - - - kernel/uid16.c:51
47 sys_getgid16 0x2f - - - - - kernel/uid16.c:222
48 sys_signal 0x30 int sig __sighandler_t handler - - - kernel/signal.c:2683
49 sys_geteuid16 0x31 - - - - - kernel/uid16.c:217
50 sys_getegid16 0x32 - - - - - kernel/uid16.c:227
51 sys_acct 0x33 const char __user *name - - - - kernel/acct.c:274
52 sys_umount 0x34 char __user *name int flags - - - fs/namespace.c:1132
53 not implemented 0x35 - - - - -
54 sys_ioctl 0x36 unsigned int fd unsigned int cmd unsigned long arg - - fs/ioctl.c:613
55 sys_fcntl 0x37 unsigned int fd unsigned int cmd unsigned long arg - - fs/fcntl.c:429
56 not implemented 0x38 - - - - -
57 sys_setpgid 0x39 pid_t pid pid_t pgid - - - kernel/sys.c:921
58 not implemented 0x3a - - - - -
59 sys_olduname 0x3b struct oldold_utsname __user * - - - - kernel/sys.c:1132
60 sys_umask 0x3c int mask - - - - kernel/sys.c:1460
61 sys_chroot 0x3d const char __user *filename - - - - fs/open.c:408
62 sys_ustat 0x3e unsigned dev struct ustat __user *ubuf - - - fs/statfs.c:175
63 sys_dup2 0x3f unsigned int oldfd unsigned int newfd - - - fs/fcntl.c:116
64 sys_getppid 0x40 - - - - - kernel/timer.c:1348
65 sys_getpgrp 0x41 - - - - - kernel/sys.c:1020
66 sys_setsid 0x42 - - - - - kernel/sys.c:1055
67 sys_sigaction 0x43 int sig const struct old_sigaction __user *act struct old_sigaction __user *oact - - arch/mips/kernel/signal.c:300
68 sys_sgetmask 0x44 - - - - - kernel/signal.c:2657
69 sys_ssetmask 0x45 int newmask - - - - kernel/signal.c:2663
70 sys_setreuid16 0x46 old_uid_t ruid old_uid_t euid - - - kernel/uid16.c:59
71 sys_setregid16 0x47 old_gid_t rgid old_gid_t egid - - - kernel/uid16.c:43
72 sys_sigsuspend 0x48 int history0 int history1 old_sigset_t mask - - arch/s390/kernel/signal.c:58
73 sys_sigpending 0x49 old_sigset_t __user *set - - - - kernel/signal.c:2562
74 sys_sethostname 0x4a char __user *name int len - - - kernel/sys.c:1165
75 sys_setrlimit 0x4b unsigned int resource struct rlimit __user *rlim - - - kernel/sys.c:1275
76 sys_old_getrlimit 0x4c unsigned int resource struct rlimit __user *rlim - - - kernel/sys.c:1256
77 sys_getrusage 0x4d int who struct rusage __user *ru - - - kernel/sys.c:1452
78 sys_gettimeofday 0x4e struct timeval __user *tv struct timezone __user *tz - - - kernel/time.c:101
79 sys_settimeofday 0x4f struct timeval __user *tv struct timezone __user *tz - - - kernel/time.c:185
80 sys_getgroups16 0x50 int gidsetsize old_gid_t __user *grouplist - - - kernel/uid16.c:164
81 sys_setgroups16 0x51 int gidsetsize old_gid_t __user *grouplist - - - kernel/uid16.c:187
82 sys_old_select 0x52 struct sel_arg_struct __user *arg - - - - fs/select.c:701
83 sys_symlink 0x53 const char __user *old const char __user *new - - - fs/namei.c:2419
84 sys_lstat 0x54 char __user *filename struct old_kernel_stat user *statbuf - - - fs/stat.c:162
85 sys_readlink 0x55 const char __user *path char __user *buf int bufsiz - - fs/stat.c:311
86 sys_uselib 0x56 const char __user *library - - - - fs/exec.c:107
87 sys_swapon 0x57 const char __user *specialfile int swap_flags - - - mm/swapfile.c:1793
88 sys_reboot 0x58 int magic1 int magic2 unsigned int cmd void __user *arg - kernel/sys.c:368
89 sys_old_readdir 0x59 unsigned int struct old_linux_dirent __user * unsigned int - - fs/readdir.c:105
90 sys_old_mmap 0x5a struct mmap_arg_struct __user *arg - - - - mm/mmap.c:1141
91 sys_munmap 0x5b unsigned long addr size_t len - - - mm/mmap.c:2109
92 sys_truncate 0x5c const char __user *path long length - - - fs/open.c:127
93 sys_ftruncate 0x5d unsigned int fd unsigned long length - - - fs/open.c:178
94 sys_fchmod 0x5e unsigned int fd mode_t mode - - - fs/open.c:436
95 sys_fchown16 0x5f unsigned int fd old_uid_t user old_gid_t group - - kernel/uid16.c:35
96 sys_getpriority 0x60 int which int who - - - kernel/sys.c:216
97 sys_setpriority 0x61 int which int who int niceval - - kernel/sys.c:149
98 not implemented 0x62 - - - - -
99 sys_statfs 0x63 const char __user * path struct statfs __user *buf - - - fs/statfs.c:102
100 sys_fstatfs 0x64 unsigned int fd struct statfs __user *buf - - - fs/statfs.c:136
101 sys_ioperm 0x65 unsigned long unsigned long int - - not found:
102 sys_socketcall 0x66 int call unsigned long __user *args - - - net/socket.c:2210
103 sys_syslog 0x67 int type char __user *buf int len - - kernel/printk.c:412
104 sys_setitimer 0x68 int which struct itimerval __user *value struct itimerval __user *ovalue - - kernel/itimer.c:279
105 sys_getitimer 0x69 int which struct itimerval __user *value - - - kernel/itimer.c:103
106 sys_newstat 0x6a char __user *filename struct stat __user *statbuf - - - fs/stat.c:237
107 sys_newlstat 0x6b char __user *filename struct stat __user *statbuf - - - fs/stat.c:247
108 sys_newfstat 0x6c unsigned int fd struct stat __user *statbuf - - - fs/stat.c:273
109 sys_uname 0x6d struct old_utsname __user * - - - - kernel/sys.c:1115
110 sys_iopl 0x6e unsigned int struct pt_regs * - - - not found:
111 sys_vhangup 0x6f - - - - - fs/open.c:1008
112 not implemented 0x70 - - - - -
113 sys_vm86old 0x71 struct vm86_struct __user * struct pt_regs * - - - not found:
114 sys_wait4 0x72 pid_t pid int __user *stat_addr int options struct rusage __user *ru - kernel/exit.c:1726
115 sys_swapoff 0x73 const char __user *specialfile - - - - mm/swapfile.c:1533
116 sys_sysinfo 0x74 struct sysinfo __user *info - - - - kernel/timer.c:1565
117 sys_ipc 0x75 - - - - - ipc/syscall.c:16
118 sys_fsync 0x76 unsigned int fd - - - - fs/sync.c:221
119 sys_sigreturn 0x77 struct pt_regs *regs - - - - arch/alpha/kernel/entry.S:758
120 sys_clone 0x78 unsigned long unsigned long unsigned long unsigned long struct pt_regs * arch/alpha/kernel/entry.S:733
121 sys_setdomainname 0x79 char __user *name int len - - - kernel/sys.c:1214
122 sys_newuname 0x7a struct new_utsname __user *name - - - - kernel/sys.c:1097
123 sys_modify_ldt 0x7b int void __user * unsigned long - - not found:
124 sys_adjtimex 0x7c struct timex __user *txc_p - - - - kernel/time.c:206
125 sys_mprotect 0x7d unsigned long start size_t len unsigned long prot - - mm/mprotect.c:221
126 sys_sigprocmask 0x7e int how old_sigset_t __user *set old_sigset_t __user *oset - - kernel/signal.c:2573
127 not implemented 0x7f - - - - -
128 sys_init_module 0x80 void __user *umod unsigned long len const char __user *uargs - - kernel/module.c:2611
129 sys_delete_module 0x81 const char __user *name_user unsigned int flags - - - kernel/module.c:720
130 not implemented 0x82 - - - - -
131 sys_quotactl 0x83 unsigned int cmd const char __user *special qid_t id void __user *addr - fs/quota/quota.c:333
132 sys_getpgid 0x84 pid_t pid - - - - kernel/sys.c:990
133 sys_fchdir 0x85 unsigned int fd - - - - fs/open.c:382
134 sys_bdflush 0x86 int func long data - - - fs/buffer.c:3278
135 sys_sysfs 0x87 int option unsigned long arg1 unsigned long arg2 - - fs/filesystems.c:182
136 sys_personality 0x88 unsigned int personality - - - - kernel/exec_domain.c:191
137 not implemented 0x89 - - - - -
138 sys_setfsuid16 0x8a old_uid_t uid - - - - kernel/uid16.c:118
139 sys_setfsgid16 0x8b old_gid_t gid - - - - kernel/uid16.c:126
140 sys_llseek 0x8c unsigned int fd unsigned long offset_high unsigned long offset_low loff_t __user *result unsigned int origin fs/read_write.c:191
141 sys_getdents 0x8d unsigned int fd struct linux_dirent __user *dirent unsigned int count - - fs/readdir.c:191
142 sys_select 0x8e int n fd_set __user *inp fd_set __user *outp fd_set __user *exp struct timeval __user *tvp fs/select.c:596
143 sys_flock 0x8f unsigned int fd unsigned int cmd - - - fs/locks.c:1569
144 sys_msync 0x90 unsigned long start size_t len int flags - - mm/msync.c:31
145 sys_readv 0x91 unsigned long fd const struct iovec __user *vec unsigned long vlen - - fs/read_write.c:711
146 sys_writev 0x92 unsigned long fd const struct iovec __user *vec unsigned long vlen - - fs/read_write.c:732
147 sys_getsid 0x93 pid_t pid - - - - kernel/sys.c:1027
148 sys_fdatasync 0x94 unsigned int fd - - - - fs/sync.c:226
149 sys_sysctl 0x95 struct sysctl_args user *args - - - - kernel/sysctl_binary.c:1462
150 sys_mlock 0x96 unsigned long start size_t len - - - mm/mlock.c:491
151 sys_munlock 0x97 unsigned long start size_t len - - - mm/mlock.c:519
152 sys_mlockall 0x98 int flags - - - - mm/mlock.c:556
153 sys_munlockall 0x99 - - - - - mm/mlock.c:584
154 sys_sched_setparam 0x9a pid_t pid struct sched_param __user *param - - - kernel/sched.c:4616
155 sys_sched_getparam 0x9b pid_t pid struct sched_param __user *param - - - kernel/sched.c:4651
156 sys_sched_setscheduler 0x9c pid_t pid int policy struct sched_param __user *param - - kernel/sched.c:4601
157 sys_sched_getscheduler 0x9d pid_t pid - - - - kernel/sched.c:4625
158 sys_sched_yield 0x9e - - - - - kernel/sched.c:4851
159 sys_sched_get_priority_max 0x9f int policy - - - - kernel/sched.c:4989
160 sys_sched_get_priority_min 0xa0 int policy - - - - kernel/sched.c:5014
161 sys_sched_rr_get_interval 0xa1 pid_t pid struct timespec __user *interval - - - kernel/sched.c:5039
162 sys_nanosleep 0xa2 struct timespec __user *rqtp struct timespec __user *rmtp - - - kernel/hrtimer.c:1606
163 sys_mremap 0xa3 unsigned long addr unsigned long old_len unsigned long new_len unsigned long flags unsigned long new_addr mm/mremap.c:510
164 sys_setresuid16 0xa4 old_uid_t ruid old_uid_t euid old_uid_t suid - - kernel/uid16.c:75
165 sys_getresuid16 0xa5 old_uid_t __user *ruid old_uid_t __user *euid old_uid_t __user *suid - - kernel/uid16.c:84
166 sys_vm86 0xa6 unsigned long unsigned long struct pt_regs * - - not found:
167 not implemented 0xa7 - - - - -
168 sys_poll 0xa8 struct pollfd __user *ufds unsigned int nfds long timeout - - fs/select.c:915
169 sys_nfsservctl 0xa9 int cmd struct nfsctl_arg __user *arg void __user *res - - fs/nfsctl.c:86
170 sys_setresgid16 0xaa old_gid_t rgid old_gid_t egid old_gid_t sgid - - kernel/uid16.c:96
171 sys_getresgid16 0xab old_gid_t __user *rgid old_gid_t __user *egid old_gid_t __user *sgid - - kernel/uid16.c:106
172 sys_prctl 0xac int option unsigned long arg2 unsigned long arg3 unsigned long arg4 unsigned long arg5 kernel/sys.c:1466
173 sys_rt_sigreturn 0xad struct pt_regs * - - - - arch/alpha/kernel/entry.S:771
174 sys_rt_sigaction 0xae int sig const struct sigaction __user *act struct sigaction __user *oact size_t sigsetsize - kernel/signal.c:2624
175 sys_rt_sigprocmask 0xaf int how sigset_t __user *set sigset_t __user *oset size_t sigsetsize - kernel/signal.c:2111
176 sys_rt_sigpending 0xb0 sigset_t __user *set size_t sigsetsize - - - kernel/signal.c:2171
177 sys_rt_sigtimedwait 0xb1 const sigset_t __user *uthese siginfo_t __user *uinfo const struct timespec __user *uts size_t sigsetsize - kernel/signal.c:2242
178 sys_rt_sigqueueinfo 0xb2 int pid int sig siginfo_t __user *uinfo - - kernel/signal.c:2404
179 sys_rt_sigsuspend 0xb3 sigset_t __user *unewset size_t sigsetsize - - - kernel/signal.c:2710
180 sys_pread64 0xb4 unsigned int fd char __user *buf size_t count loff_t pos - not found:
181 sys_pwrite64 0xb5 unsigned int fd const char __user *buf size_t count loff_t pos - not found:
182 sys_chown16 0xb6 const char __user *filename old_uid_t user old_gid_t group - - kernel/uid16.c:19
183 sys_getcwd 0xb7 char __user *buf unsigned long size - - - fs/dcache.c:2104
184 sys_capget 0xb8 cap_user_header_t header cap_user_data_t dataptr - - - kernel/capability.c:161
185 sys_capset 0xb9 cap_user_header_t header const cap_user_data_t data - - - kernel/capability.c:235
186 sys_sigaltstack 0xba const stack_t __user * stack_t __user * struct pt_regs * - - arch/alpha/kernel/signal.c:199
187 sys_sendfile 0xbb int out_fd int in_fd off_t __user *offset size_t count - fs/read_write.c:897
188 not implemented 0xbc - - - - -
189 not implemented 0xbd - - - - -
190 sys_vfork 0xbe struct pt_regs * - - - - arch/alpha/kernel/entry.S:746
191 sys_getrlimit 0xbf unsigned int resource struct rlimit __user *rlim - - - kernel/sys.c:1237
192 sys_mmap_pgoff 0xc0 - - - - - mm/mmap.c:1091
193 sys_truncate64 0xc1 const char __user *path loff_t length - - - not found:
194 sys_ftruncate64 0xc2 unsigned int fd loff_t length - - - not found:
195 sys_stat64 0xc3 char __user *filename struct stat64 __user *statbuf - - - fs/stat.c:358
196 sys_lstat64 0xc4 char __user *filename struct stat64 __user *statbuf - - - fs/stat.c:369
197 sys_fstat64 0xc5 unsigned long fd struct stat64 __user *statbuf - - - fs/stat.c:380
198 sys_lchown 0xc6 const char __user *filename uid_t user gid_t group - - fs/open.c:583
199 sys_getuid 0xc7 - - - - - kernel/timer.c:1359
200 sys_getgid 0xc8 - - - - - kernel/timer.c:1371
201 sys_geteuid 0xc9 - - - - - kernel/timer.c:1365
202 sys_getegid 0xca - - - - - kernel/timer.c:1377
203 sys_setreuid 0xcb uid_t ruid uid_t euid - - - kernel/sys.c:594
204 sys_setregid 0xcc gid_t rgid gid_t egid - - - kernel/sys.c:484
205 sys_getgroups 0xcd int gidsetsize gid_t __user *grouplist - - - kernel/groups.c:203
206 sys_setgroups 0xce int gidsetsize gid_t __user *grouplist - - - kernel/groups.c:232
207 sys_fchown 0xcf unsigned int fd uid_t user gid_t group - - fs/open.c:602
208 sys_setresuid 0xd0 uid_t ruid uid_t euid uid_t suid - - kernel/sys.c:696
209 sys_getresuid 0xd1 uid_t __user *ruid uid_t __user *euid uid_t __user *suid - - kernel/sys.c:746
210 sys_setresgid 0xd2 gid_t rgid gid_t egid gid_t sgid - - kernel/sys.c:761
211 sys_getresgid 0xd3 gid_t __user *rgid gid_t __user *egid gid_t __user *sgid - - kernel/sys.c:800
212 sys_chown 0xd4 const char __user *filename uid_t user gid_t group - - fs/open.c:539
213 sys_setuid 0xd5 uid_t uid - - - - kernel/sys.c:655
214 sys_setgid 0xd6 gid_t gid - - - - kernel/sys.c:531
215 sys_setfsuid 0xd7 uid_t uid - - - - kernel/sys.c:819
216 sys_setfsgid 0xd8 gid_t gid - - - - kernel/sys.c:852
217 sys_pivot_root 0xd9 const char __user *new_root const char __user *put_old - - - fs/namespace.c:2184
218 sys_mincore 0xda unsigned long start size_t len unsigned char __user * vec - - mm/mincore.c:256
219 sys_madvise 0xdb unsigned long start size_t len int behavior - - mm/madvise.c:335
220 sys_getdents64 0xdc unsigned int fd struct linux_dirent64 __user *dirent unsigned int count - - fs/readdir.c:273
221 sys_fcntl64 0xdd unsigned int fd unsigned int cmd unsigned long arg - - fs/fcntl.c:452
222 not implemented 0xde - - - - -
223 not implemented 0xdf - - - - -
224 sys_gettid 0xe0 - - - - - kernel/timer.c:1493
225 sys_readahead 0xe1 int fd loff_t offset size_t count - - not found:
226 sys_setxattr 0xe2 const char __user *path const char __user *name const void __user *value size_t size int flags fs/xattr.c:279
227 sys_lsetxattr 0xe3 const char __user *path const char __user *name const void __user *value size_t size int flags fs/xattr.c:298
228 sys_fsetxattr 0xe4 int fd const char __user *name const void __user *value size_t size int flags fs/xattr.c:317
229 sys_getxattr 0xe5 const char __user *path const char __user *name void __user *value size_t size - fs/xattr.c:376
230 sys_lgetxattr 0xe6 const char __user *path const char __user *name void __user *value size_t size - fs/xattr.c:390
231 sys_fgetxattr 0xe7 int fd const char __user *name void __user *value size_t size - fs/xattr.c:404
232 sys_listxattr 0xe8 const char __user *path char __user *list size_t size - - fs/xattr.c:449
233 sys_llistxattr 0xe9 const char __user *path char __user *list size_t size - - fs/xattr.c:463
234 sys_flistxattr 0xea int fd char __user *list size_t size - - fs/xattr.c:477
235 sys_removexattr 0xeb const char __user *path const char __user *name - - - fs/xattr.c:509
236 sys_lremovexattr 0xec const char __user *path const char __user *name - - - fs/xattr.c:527
237 sys_fremovexattr 0xed int fd const char __user *name - - - fs/xattr.c:545
238 sys_tkill 0xee int pid int sig - - - kernel/signal.c:2395
239 sys_sendfile64 0xef int out_fd int in_fd loff_t __user *offset size_t count - fs/read_write.c:916
240 sys_futex 0xf0 - - - - - kernel/futex.c:2605
241 sys_sched_setaffinity 0xf1 pid_t pid unsigned int len unsigned long __user *user_mask_ptr - - kernel/sched.c:4765
242 sys_sched_getaffinity 0xf2 pid_t pid unsigned int len unsigned long __user *user_mask_ptr - - kernel/sched.c:4817
243 sys_set_thread_area 0xf3 struct user_desc __user * - - - - arch/mips/kernel/syscall.c:222
244 sys_get_thread_area 0xf4 struct user_desc __user * - - - - not found:
245 sys_io_setup 0xf5 unsigned nr_reqs aio_context_t __user *ctx - - - fs/aio.c:1245
246 sys_io_destroy 0xf6 aio_context_t ctx - - - - fs/aio.c:1283
247 sys_io_getevents 0xf7 aio_context_t ctx_id long min_nr long nr struct io_event __user *events struct timespec __user *timeout fs/aio.c:1808
248 sys_io_submit 0xf8 aio_context_t long struct iocb user * user * - - fs/aio.c:1711
249 sys_io_cancel 0xf9 aio_context_t ctx_id struct iocb __user *iocb struct io_event __user *result - - fs/aio.c:1746
250 sys_fadvise64 0xfa int fd loff_t offset size_t len int advice - not found:
251 not implemented 0xfb - - - - -
252 sys_exit_group 0xfc int error_code - - - - kernel/exit.c:1087
253 sys_lookup_dcookie 0xfd u64 cookie64 char __user *buf size_t len - - not found:
254 sys_epoll_create 0xfe int size - - - - fs/eventpoll.c:1215
255 sys_epoll_ctl 0xff int epfd int op int fd struct epoll_event __user *event - fs/eventpoll.c:1228
256 sys_epoll_wait 0x100 int epfd struct epoll_event __user *events int maxevents int timeout - fs/eventpoll.c:1320
257 sys_remap_file_pages 0x101 unsigned long start unsigned long size unsigned long prot unsigned long pgoff unsigned long flags mm/fremap.c:123
258 sys_set_tid_address 0x102 int __user *tidptr - - - - kernel/fork.c:920
259 sys_timer_create 0x103 clockid_t which_clock struct sigevent __user *timer_event_spec timer_t __user * created_timer_id - - kernel/posix-timers.c:522
260 sys_timer_settime 0x104 timer_t timer_id int flags const struct itimerspec __user *new_setting struct itimerspec __user *old_setting - kernel/posix-timers.c:800
261 sys_timer_gettime 0x105 timer_t timer_id struct itimerspec __user *setting - - - kernel/posix-timers.c:702
262 sys_timer_getoverrun 0x106 timer_t timer_id - - - - kernel/posix-timers.c:732
263 sys_timer_delete 0x107 timer_t timer_id - - - - kernel/posix-timers.c:855
264 sys_clock_settime 0x108 clockid_t which_clock const struct timespec __user *tp - - - kernel/posix-timers.c:941
265 sys_clock_gettime 0x109 clockid_t which_clock struct timespec __user *tp - - - kernel/posix-timers.c:954
266 sys_clock_getres 0x10a clockid_t which_clock struct timespec __user *tp - - - kernel/posix-timers.c:971
267 sys_clock_nanosleep 0x10b clockid_t which_clock int flags const struct timespec __user *rqtp struct timespec __user *rmtp - kernel/posix-timers.c:1001
268 sys_statfs64 0x10c const char __user *path size_t sz struct statfs64 __user *buf - - fs/statfs.c:118
269 sys_fstatfs64 0x10d unsigned int fd size_t sz struct statfs64 __user *buf - - fs/statfs.c:154
270 sys_tgkill 0x10e int tgid int pid int sig - - kernel/signal.c:2383
271 sys_utimes 0x10f char __user *filename struct timeval __user *utimes - - - fs/utimes.c:219
272 sys_fadvise64_64 0x110 int fd loff_t offset loff_t len int advice - not found:
273 not implemented 0x111 - - - - -
274 sys_mbind 0x112 - - - - - mm/mempolicy.c:1232
275 sys_get_mempolicy 0x113 int __user *policy unsigned long __user *nmask unsigned long maxnode unsigned long addr unsigned long flags mm/mempolicy.c:1348
276 sys_set_mempolicy 0x114 int mode unsigned long __user *nmask unsigned long maxnode - - mm/mempolicy.c:1254
277 sys_mq_open 0x115 const char __user *name int oflag mode_t mode struct mq_attr __user *attr - ipc/mqueue.c:673
278 sys_mq_unlink 0x116 const char __user *name - - - - ipc/mqueue.c:746
279 sys_mq_timedsend 0x117 mqd_t mqdes const char __user *msg_ptr size_t msg_len unsigned int msg_prio const struct timespec __user *abs_timeout ipc/mqueue.c:840
280 sys_mq_timedreceive 0x118 mqd_t mqdes char __user *msg_ptr size_t msg_len unsigned int __user *msg_prio const struct timespec __user *abs_timeout ipc/mqueue.c:934
281 sys_mq_notify 0x119 mqd_t mqdes const struct sigevent __user *notification - - - ipc/mqueue.c:1023
282 sys_mq_getsetattr 0x11a mqd_t mqdes const struct mq_attr __user *mqstat struct mq_attr __user *omqstat - - ipc/mqueue.c:1154
283 sys_kexec_load 0x11b unsigned long entry unsigned long nr_segments struct kexec_segment __user *segments unsigned long flags - kernel/kexec.c:939
284 sys_waitid 0x11c int which pid_t pid struct siginfo __user *infop int options struct rusage __user *ru kernel/exit.c:1655
285 not implemented 0x11d - - - - -
286 sys_add_key 0x11e const char __user *_type const char __user *_description const void __user *_payload size_t plen key_serial_t destringid security/keys/keyctl.c:57
287 sys_request_key 0x11f const char __user *_type const char __user *_description const char __user *_callout_info key_serial_t destringid - security/keys/keyctl.c:149
288 sys_keyctl 0x120 int cmd unsigned long arg2 unsigned long arg3 unsigned long arg4 unsigned long arg5 security/keys/keyctl.c:1338
289 sys_ioprio_set 0x121 int which int who int ioprio - - fs/ioprio.c:76
290 sys_ioprio_get 0x122 int which int who - - - fs/ioprio.c:192
291 sys_inotify_init 0x123 - - - - - fs/notify/inotify/inotify_user.c:680
292 sys_inotify_add_watch 0x124 int fd const char __user *path u32 mask - - fs/notify/inotify/inotify_user.c:685
293 sys_inotify_rm_watch 0x125 int fd __s32 wd - - - fs/notify/inotify/inotify_user.c:726
294 sys_migrate_pages 0x126 pid_t pid unsigned long maxnode const unsigned long __user *from const unsigned long __user *to - mm/mempolicy.c:1273
295 sys_openat 0x127 int dfd const char __user *filename int flags int mode - fs/open.c:913
296 sys_mkdirat 0x128 int dfd const char __user * pathname int mode - - fs/namei.c:2093
297 sys_mknodat 0x129 int dfd const char __user * filename int mode unsigned dev - fs/namei.c:2012
298 sys_fchownat 0x12a int dfd const char __user *filename uid_t user gid_t group int flag fs/open.c:558
299 sys_futimesat 0x12b int dfd char __user *filename struct timeval __user *utimes - - fs/utimes.c:191
300 sys_fstatat64 0x12c int dfd char __user *filename struct stat64 __user *statbuf int flag - fs/stat.c:391
301 sys_unlinkat 0x12d int dfd const char __user * pathname int flag - - fs/namei.c:2341
302 sys_renameat 0x12e int olddfd const char __user * oldname int newdfd const char __user * newname - fs/namei.c:2671
303 sys_linkat 0x12f int olddfd const char __user *oldname int newdfd const char __user *newname int flags fs/namei.c:2470
304 sys_symlinkat 0x130 const char __user * oldname int newdfd const char __user * newname - - fs/namei.c:2377
305 sys_readlinkat 0x131 int dfd const char __user *path char __user *buf int bufsiz - fs/stat.c:284
306 sys_fchmodat 0x132 int dfd const char __user * filename mode_t mode - - fs/open.c:474
307 sys_faccessat 0x133 int dfd const char __user *filename int mode - - fs/open.c:286
308 sys_pselect6 0x134 - - - - - fs/select.c:675
309 sys_ppoll 0x135 struct pollfd __user *ufds unsigned int nfds struct timespec __user *tsp const sigset_t __user *sigmask size_t sigsetsize fs/select.c:950
310 sys_unshare 0x136 unsigned long unshare_flags - - - - kernel/fork.c:1624
311 sys_set_robust_list 0x137 struct robust_list_head __user *head size_t len - - - kernel/futex.c:2351
312 sys_get_robust_list 0x138 int pid struct robust_list_head user * user *head_ptr size_t __user *len_ptr - - kernel/futex.c:2373
313 sys_splice 0x139 - - - - - fs/splice.c:1718
314 sys_sync_file_range 0x13a int fd loff_t offset loff_t nbytes unsigned int flags - not found:
315 sys_tee 0x13b int fdin int fdout size_t len unsigned int flags - fs/splice.c:2061
316 sys_vmsplice 0x13c int fd const struct iovec __user *iov unsigned long nr_segs unsigned int flags - fs/splice.c:1692
317 sys_move_pages 0x13d - - - - - mm/migrate.c:1075
318 sys_getcpu 0x13e unsigned __user *cpu unsigned __user *node struct getcpu_cache __user *cache - - kernel/sys.c:1621
319 sys_epoll_pwait 0x13f - - - - - fs/eventpoll.c:1373
320 sys_utimensat 0x140 int dfd char __user *filename struct timespec __user *utimes int flags - fs/utimes.c:173
321 sys_signalfd 0x141 int ufd sigset_t __user *user_mask size_t sizemask - - fs/signalfd.c:265
322 sys_timerfd_create 0x142 int clockid int flags - - - fs/timerfd.c:164
323 sys_eventfd 0x143 unsigned int count - - - - fs/eventfd.c:434
324 sys_fallocate 0x144 int fd int mode loff_t offset loff_t len - not found:
325 sys_timerfd_settime 0x145 int ufd int flags const struct itimerspec __user *utmr struct itimerspec __user *otmr - fs/timerfd.c:194
326 sys_timerfd_gettime 0x146 int ufd struct itimerspec __user *otmr - - - fs/timerfd.c:252
327 sys_signalfd4 0x147 int ufd sigset_t __user *user_mask size_t sizemask int flags - fs/signalfd.c:211
328 sys_eventfd2 0x148 unsigned int count int flags - - - fs/eventfd.c:409
329 sys_epoll_create1 0x149 int flags - - - - fs/eventpoll.c:1187
330 sys_dup3 0x14a unsigned int oldfd unsigned int newfd int flags - - fs/fcntl.c:53
331 sys_pipe2 0x14b int __user *fildes int flags - - - fs/pipe.c:1101
332 sys_inotify_init1 0x14c int flags - - - - fs/notify/inotify/inotify_user.c:640
333 sys_preadv 0x14d unsigned long fd const struct iovec __user *vec unsigned long vlen unsigned long pos_l unsigned long pos_h fs/read_write.c:759
334 sys_pwritev 0x14e unsigned long fd const struct iovec __user *vec unsigned long vlen unsigned long pos_l unsigned long pos_h fs/read_write.c:784
335 sys_rt_tgsigqueueinfo 0x14f pid_t tgid pid_t pid int sig siginfo_t __user *uinfo - kernel/signal.c:2437
336 sys_perf_event_open 0x150 struct perf_event_attr __user *attr_uptr pid_t pid int cpu int group_fd unsigned long flags kernel/perf_event.c:5065
337 sys_recvmmsg 0x151 int fd struct mmsghdr __user *msg unsigned int vlen unsigned flags struct timespec __user *timeout net/socket.c:2168

6.2 64系统调用表

%rax System call %rdi %rsi %rdx %r10 %r8 %r9
0 sys_read unsigned int fd char *buf size_t count
1 sys_write unsigned int fd const char *buf size_t count
2 sys_open const char *filename int flags int mode
3 sys_close unsigned int fd
4 sys_stat const char *filename struct stat *statbuf
5 sys_fstat unsigned int fd struct stat *statbuf
6 sys_lstat fconst char *filename struct stat *statbuf
7 sys_poll struct poll_fd *ufds unsigned int nfds long timeout_msecs
8 sys_lseek unsigned int fd off_t offset unsigned int origin
9 sys_mmap unsigned long addr unsigned long len unsigned long prot unsigned long flags unsigned long fd unsigned long off
10 sys_mprotect unsigned long start size_t len unsigned long prot
11 sys_munmap unsigned long addr size_t len
12 sys_brk unsigned long brk
13 sys_rt_sigaction int sig const struct sigaction *act struct sigaction *oact size_t sigsetsize
14 sys_rt_sigprocmask int how sigset_t *nset sigset_t *oset size_t sigsetsize
15 sys_rt_sigreturn unsigned long __unused
16 sys_ioctl unsigned int fd unsigned int cmd unsigned long arg
17 sys_pread64 unsigned long fd char *buf size_t count loff_t pos
18 sys_pwrite64 unsigned int fd const char *buf size_t count loff_t pos
19 sys_readv unsigned long fd const struct iovec *vec unsigned long vlen
20 sys_writev unsigned long fd const struct iovec *vec unsigned long vlen
21 sys_access const char *filename int mode
22 sys_pipe int *filedes
23 sys_select int n fd_set *inp fd_set *outp fd_set*exp struct timeval *tvp
24 sys_sched_yield
25 sys_mremap unsigned long addr unsigned long old_len unsigned long new_len unsigned long flags unsigned long new_addr
26 sys_msync unsigned long start size_t len int flags
27 sys_mincore unsigned long start size_t len unsigned char *vec
28 sys_madvise unsigned long start size_t len_in int behavior
29 sys_shmget key_t key size_t size int shmflg
30 sys_shmat int shmid char *shmaddr int shmflg
31 sys_shmctl int shmid int cmd struct shmid_ds *buf
32 sys_dup unsigned int fildes
33 sys_dup2 unsigned int oldfd unsigned int newfd
34 sys_pause
35 sys_nanosleep struct timespec *rqtp struct timespec *rmtp
36 sys_getitimer int which struct itimerval *value
37 sys_alarm unsigned int seconds
38 sys_setitimer int which struct itimerval *value struct itimerval *ovalue
39 sys_getpid
40 sys_sendfile int out_fd int in_fd off_t *offset size_t count
41 sys_socket int family int type int protocol
42 sys_connect int fd struct sockaddr *uservaddr int addrlen
43 sys_accept int fd struct sockaddr *upeer_sockaddr int *upeer_addrlen
44 sys_sendto int fd void *buff size_t len unsigned flags struct sockaddr *addr int addr_len
45 sys_recvfrom int fd void *ubuf size_t size unsigned flags struct sockaddr *addr int *addr_len
46 sys_sendmsg int fd struct msghdr *msg unsigned flags
47 sys_recvmsg int fd struct msghdr *msg unsigned int flags
48 sys_shutdown int fd int how
49 sys_bind int fd struct sokaddr *umyaddr int addrlen
50 sys_listen int fd int backlog
51 sys_getsockname int fd struct sockaddr *usockaddr int *usockaddr_len
52 sys_getpeername int fd struct sockaddr *usockaddr int *usockaddr_len
53 sys_socketpair int family int type int protocol int *usockvec
54 sys_setsockopt int fd int level int optname char *optval int optlen
55 sys_getsockopt int fd int level int optname char *optval int *optlen
56 sys_clone unsigned long clone_flags unsigned long newsp void *parent_tid void *child_tid
57 sys_fork
58 sys_vfork
59 sys_execve const char *filename const char *const argv[] const char *const envp[]
60 sys_exit int error_code
61 sys_wait4 pid_t upid int *stat_addr int options struct rusage *ru
62 sys_kill pid_t pid int sig
63 sys_uname struct old_utsname *name
64 sys_semget key_t key int nsems int semflg
65 sys_semop int semid struct sembuf *tsops unsigned nsops
66 sys_semctl int semid int semnum int cmd union semun arg
67 sys_shmdt char *shmaddr
68 sys_msgget key_t key int msgflg
69 sys_msgsnd int msqid struct msgbuf *msgp size_t msgsz int msgflg
70 sys_msgrcv int msqid struct msgbuf *msgp size_t msgsz long msgtyp int msgflg
71 sys_msgctl int msqid int cmd struct msqid_ds *buf
72 sys_fcntl unsigned int fd unsigned int cmd unsigned long arg
73 sys_flock unsigned int fd unsigned int cmd
74 sys_fsync unsigned int fd
75 sys_fdatasync unsigned int fd
76 sys_truncate const char *path long length
77 sys_ftruncate unsigned int fd unsigned long length
78 sys_getdents unsigned int fd struct linux_dirent *dirent unsigned int count
79 sys_getcwd char *buf unsigned long size
80 sys_chdir const char *filename
81 sys_fchdir unsigned int fd
82 sys_rename const char *oldname const char *newname
83 sys_mkdir const char *pathname int mode
84 sys_rmdir const char *pathname
85 sys_creat const char *pathname int mode
86 sys_link const char *oldname const char *newname
87 sys_unlink const char *pathname
88 sys_symlink const char *oldname const char *newname
89 sys_readlink const char *path char *buf int bufsiz
90 sys_chmod const char *filename mode_t mode
91 sys_fchmod unsigned int fd mode_t mode
92 sys_chown const char *filename uid_t user gid_t group
93 sys_fchown unsigned int fd uid_t user gid_t group
94 sys_lchown const char *filename uid_t user gid_t group
95 sys_umask int mask
96 sys_gettimeofday struct timeval *tv struct timezone *tz
97 sys_getrlimit unsigned int resource struct rlimit *rlim
98 sys_getrusage int who struct rusage *ru
99 sys_sysinfo struct sysinfo *info
100 sys_times struct sysinfo *info
101 sys_ptrace long request long pid unsigned long addr unsigned long data
102 sys_getuid
103 sys_syslog int type char *buf int len
104 sys_getgid
105 sys_setuid uid_t uid
106 sys_setgid gid_t gid
107 sys_geteuid
108 sys_getegid
109 sys_setpgid pid_t pid pid_t pgid
110 sys_getppid
111 sys_getpgrp
112 sys_setsid
113 sys_setreuid uid_t ruid uid_t euid
114 sys_setregid gid_t rgid gid_t egid
115 sys_getgroups int gidsetsize gid_t *grouplist
116 sys_setgroups int gidsetsize gid_t *grouplist
117 sys_setresuid uid_t *ruid uid_t *euid uid_t *suid
118 sys_getresuid uid_t *ruid uid_t *euid uid_t *suid
119 sys_setresgid gid_t rgid gid_t egid gid_t sgid
120 sys_getresgid gid_t *rgid gid_t *egid gid_t *sgid
121 sys_getpgid pid_t pid
122 sys_setfsuid uid_t uid
123 sys_setfsgid gid_t gid
124 sys_getsid pid_t pid
125 sys_capget cap_user_header_t header cap_user_data_t dataptr
126 sys_capset cap_user_header_t header const cap_user_data_t data
127 sys_rt_sigpending sigset_t *set size_t sigsetsize
128 sys_rt_sigtimedwait const sigset_t *uthese siginfo_t *uinfo const struct timespec *uts size_t sigsetsize
129 sys_rt_sigqueueinfo pid_t pid int sig siginfo_t *uinfo
130 sys_rt_sigsuspend sigset_t *unewset size_t sigsetsize
131 sys_sigaltstack const stack_t *uss stack_t *uoss
132 sys_utime char *filename struct utimbuf *times
133 sys_mknod const char *filename umode_t mode unsigned dev
134 sys_uselib NOT IMPLEMENTED
135 sys_personality unsigned int personality
136 sys_ustat unsigned dev struct ustat *ubuf
137 sys_statfs const char *pathname struct statfs *buf
138 sys_fstatfs unsigned int fd struct statfs *buf
139 sys_sysfs int option unsigned long arg1 unsigned long arg2
140 sys_getpriority int which int who
141 sys_setpriority int which int who int niceval
142 sys_sched_setparam pid_t pid struct sched_param *param
143 sys_sched_getparam pid_t pid struct sched_param *param
144 sys_sched_setscheduler pid_t pid int policy struct sched_param *param
145 sys_sched_getscheduler pid_t pid
146 sys_sched_get_priority_max int policy
147 sys_sched_get_priority_min int policy
148 sys_sched_rr_get_interval pid_t pid struct timespec *interval
149 sys_mlock unsigned long start size_t len
150 sys_munlock unsigned long start size_t len
151 sys_mlockall int flags
152 sys_munlockall
153 sys_vhangup
154 sys_modify_ldt int func void *ptr unsigned long bytecount
155 sys_pivot_root const char *new_root const char *put_old
156 sys__sysctl struct __sysctl_args *args
157 sys_prctl int option unsigned long arg2 unsigned long arg3 unsigned long arg4 unsigned long arg5
158 sys_arch_prctl struct task_struct *task int code unsigned long *addr
159 sys_adjtimex struct timex *txc_p
160 sys_setrlimit unsigned int resource struct rlimit *rlim
161 sys_chroot const char *filename
162 sys_sync
163 sys_acct const char *name
164 sys_settimeofday struct timeval *tv struct timezone *tz
165 sys_mount char *dev_name char *dir_name char *type unsigned long flags void *data
166 sys_umount2 const char *target int flags
167 sys_swapon const char *specialfile int swap_flags
168 sys_swapoff const char *specialfile
169 sys_reboot int magic1 int magic2 unsigned int cmd void *arg
170 sys_sethostname char *name int len
171 sys_setdomainname char *name int len
172 sys_iopl unsigned int level struct pt_regs *regs
173 sys_ioperm unsigned long from unsigned long num int turn_on
174 sys_create_module REMOVED IN Linux 2.6
175 sys_init_module void *umod unsigned long len const char *uargs
176 sys_delete_module const chat *name_user unsigned int flags
177 sys_get_kernel_syms REMOVED IN Linux 2.6
178 sys_query_module REMOVED IN Linux 2.6
179 sys_quotactl unsigned int cmd const char *special qid_t id void *addr
180 sys_nfsservctl NOT IMPLEMENTED
181 sys_getpmsg NOT IMPLEMENTED
182 sys_putpmsg NOT IMPLEMENTED
183 sys_afs_syscall NOT IMPLEMENTED
184 sys_tuxcall NOT IMPLEMENTED
185 sys_security NOT IMPLEMENTED
186 sys_gettid
187 sys_readahead int fd loff_t offset size_t count
188 sys_setxattr const char *pathname const char *name const void *value size_t size int flags
189 sys_lsetxattr const char *pathname const char *name const void *value size_t size int flags
190 sys_fsetxattr int fd const char *name const void *value size_t size int flags
191 sys_getxattr const char *pathname const char *name void *value size_t size
192 sys_lgetxattr const char *pathname const char *name void *value size_t size
193 sys_fgetxattr int fd const har *name void *value size_t size
194 sys_listxattr const char *pathname char *list size_t size
195 sys_llistxattr const char *pathname char *list size_t size
196 sys_flistxattr int fd char *list size_t size
197 sys_removexattr const char *pathname const char *name
198 sys_lremovexattr const char *pathname const char *name
199 sys_fremovexattr int fd const char *name
200 sys_tkill pid_t pid ing sig
201 sys_time time_t *tloc
202 sys_futex u32 *uaddr int op u32 val struct timespec *utime u32 *uaddr2 u32 val3
203 sys_sched_setaffinity pid_t pid unsigned int len unsigned long *user_mask_ptr
204 sys_sched_getaffinity pid_t pid unsigned int len unsigned long *user_mask_ptr
205 sys_set_thread_area NOT IMPLEMENTED. Use arch_prctl
206 sys_io_setup unsigned nr_events aio_context_t *ctxp
207 sys_io_destroy aio_context_t ctx
208 sys_io_getevents aio_context_t ctx_id long min_nr long nr struct io_event *events
209 sys_io_submit aio_context_t ctx_id long nr struct iocb **iocbpp
210 sys_io_cancel aio_context_t ctx_id struct iocb *iocb struct io_event *result
211 sys_get_thread_area NOT IMPLEMENTED. Use arch_prctl
212 sys_lookup_dcookie u64 cookie64 long buf long len
213 sys_epoll_create int size
214 sys_epoll_ctl_old NOT IMPLEMENTED
215 sys_epoll_wait_old NOT IMPLEMENTED
216 sys_remap_file_pages unsigned long start unsigned long size unsigned long prot unsigned long pgoff unsigned long flags
217 sys_getdents64 unsigned int fd struct linux_dirent64 *dirent unsigned int count
218 sys_set_tid_address int *tidptr
219 sys_restart_syscall
220 sys_semtimedop int semid struct sembuf *tsops unsigned nsops const struct timespec *timeout
221 sys_fadvise64 int fd loff_t offset size_t len int advice
222 sys_timer_create const clockid_t which_clock struct sigevent *timer_event_spec timer_t *created_timer_id
223 sys_timer_settime timer_t timer_id int flags const struct itimerspec *new_setting struct itimerspec *old_setting
224 sys_timer_gettime timer_t timer_id struct itimerspec *setting
225 sys_timer_getoverrun timer_t timer_id
226 sys_timer_delete timer_t timer_id
227 sys_clock_settime const clockid_t which_clock const struct timespec *tp
228 sys_clock_gettime const clockid_t which_clock struct timespec *tp
229 sys_clock_getres const clockid_t which_clock struct timespec *tp
230 sys_clock_nanosleep const clockid_t which_clock int flags const struct timespec *rqtp struct timespec *rmtp
231 sys_exit_group int error_code
232 sys_epoll_wait int epfd struct epoll_event *events int maxevents int timeout
233 sys_epoll_ctl int epfd int op int fd struct epoll_event *event
234 sys_tgkill pid_t tgid pid_t pid int sig
235 sys_utimes char *filename struct timeval *utimes
236 sys_vserver NOT IMPLEMENTED
237 sys_mbind unsigned long start unsigned long len unsigned long mode unsigned long *nmask unsigned long maxnode unsigned flags
238 sys_set_mempolicy int mode unsigned long *nmask unsigned long maxnode
239 sys_get_mempolicy int *policy unsigned long *nmask unsigned long maxnode unsigned long addr unsigned long flags
240 sys_mq_open const char *u_name int oflag mode_t mode struct mq_attr *u_attr
241 sys_mq_unlink const char *u_name
242 sys_mq_timedsend mqd_t mqdes const char *u_msg_ptr size_t msg_len unsigned int msg_prio const stuct timespec *u_abs_timeout
243 sys_mq_timedreceive mqd_t mqdes char *u_msg_ptr size_t msg_len unsigned int *u_msg_prio const struct timespec *u_abs_timeout
244 sys_mq_notify mqd_t mqdes const struct sigevent *u_notification
245 sys_mq_getsetattr mqd_t mqdes const struct mq_attr *u_mqstat struct mq_attr *u_omqstat
246 sys_kexec_load unsigned long entry unsigned long nr_segments struct kexec_segment *segments unsigned long flags
247 sys_waitid int which pid_t upid struct siginfo *infop int options struct rusage *ru
248 sys_add_key const char *_type const char *_description const void *_payload size_t plen
249 sys_request_key const char *_type const char *_description const char *_callout_info key_serial_t destringid
250 sys_keyctl int option unsigned long arg2 unsigned long arg3 unsigned long arg4 unsigned long arg5
251 sys_ioprio_set int which int who int ioprio
252 sys_ioprio_get int which int who
253 sys_inotify_init
254 sys_inotify_add_watch int fd const char *pathname u32 mask
255 sys_inotify_rm_watch int fd __s32 wd
256 sys_migrate_pages pid_t pid unsigned long maxnode const unsigned long *old_nodes const unsigned long *new_nodes
257 sys_openat int dfd const char *filename int flags int mode
258 sys_mkdirat int dfd const char *pathname int mode
259 sys_mknodat int dfd const char *filename int mode unsigned dev
260 sys_fchownat int dfd const char *filename uid_t user gid_t group int flag
261 sys_futimesat int dfd const char *filename struct timeval *utimes
262 sys_newfstatat int dfd const char *filename struct stat *statbuf int flag
263 sys_unlinkat int dfd const char *pathname int flag
264 sys_renameat int oldfd const char *oldname int newfd const char *newname
265 sys_linkat int oldfd const char *oldname int newfd const char *newname int flags
266 sys_symlinkat const char *oldname int newfd const char *newname
267 sys_readlinkat int dfd const char *pathname char *buf int bufsiz
268 sys_fchmodat int dfd const char *filename mode_t mode
269 sys_faccessat int dfd const char *filename int mode
270 sys_pselect6 int n fd_set *inp fd_set *outp fd_set *exp struct timespec *tsp void *sig
271 sys_ppoll struct pollfd *ufds unsigned int nfds struct timespec *tsp const sigset_t *sigmask size_t sigsetsize
272 sys_unshare unsigned long unshare_flags
273 sys_set_robust_list struct robust_list_head *head size_t len
274 sys_get_robust_list int pid struct robust_list_head **head_ptr size_t *len_ptr
275 sys_splice int fd_in loff_t *off_in int fd_out loff_t *off_out size_t len unsigned int flags
276 sys_tee int fdin int fdout size_t len unsigned int flags
277 sys_sync_file_range long fd loff_t offset loff_t bytes long flags
278 sys_vmsplice int fd const struct iovec *iov unsigned long nr_segs unsigned int flags
279 sys_move_pages pid_t pid unsigned long nr_pages const void **pages const int *nodes int *status int flags
280 sys_utimensat int dfd const char *filename struct timespec *utimes int flags
281 sys_epoll_pwait int epfd struct epoll_event *events int maxevents int timeout const sigset_t *sigmask size_t sigsetsize
282 sys_signalfd int ufd sigset_t *user_mask size_t sizemask
283 sys_timerfd_create int clockid int flags
284 sys_eventfd unsigned int count
285 sys_fallocate long fd long mode loff_t offset loff_t len
286 sys_timerfd_settime int ufd int flags const struct itimerspec *utmr struct itimerspec *otmr
287 sys_timerfd_gettime int ufd struct itimerspec *otmr
288 sys_accept4 int fd struct sockaddr *upeer_sockaddr int *upeer_addrlen int flags
289 sys_signalfd4 int ufd sigset_t *user_mask size_t sizemask int flags
290 sys_eventfd2 unsigned int count int flags
291 sys_epoll_create1 int flags
292 sys_dup3 unsigned int oldfd unsigned int newfd int flags
293 sys_pipe2 int *filedes int flags
294 sys_inotify_init1 int flags
295 sys_preadv unsigned long fd const struct iovec *vec unsigned long vlen unsigned long pos_l unsigned long pos_h
296 sys_pwritev unsigned long fd const struct iovec *vec unsigned long vlen unsigned long pos_l unsigned long pos_h
297 sys_rt_tgsigqueueinfo pid_t tgid pid_t pid int sig siginfo_t *uinfo
298 sys_perf_event_open struct perf_event_attr *attr_uptr pid_t pid int cpu int group_fd unsigned long flags
299 sys_recvmmsg int fd struct msghdr *mmsg unsigned int vlen unsigned int flags struct timespec *timeout
300 sys_fanotify_init unsigned int flags unsigned int event_f_flags
301 sys_fanotify_mark long fanotify_fd long flags __u64 mask long dfd long pathname
302 sys_prlimit64 pid_t pid unsigned int resource const struct rlimit64 *new_rlim struct rlimit64 *old_rlim
303 sys_name_to_handle_at int dfd const char *name struct file_handle *handle int *mnt_id int flag
304 sys_open_by_handle_at int dfd const char *name struct file_handle *handle int *mnt_id int flags
305 sys_clock_adjtime clockid_t which_clock struct timex *tx
306 sys_syncfs int fd
307 sys_sendmmsg int fd struct mmsghdr *mmsg unsigned int vlen unsigned int flags
308 sys_setns int fd int nstype
309 sys_getcpu unsigned *cpup unsigned *nodep struct getcpu_cache *unused
310 sys_process_vm_readv pid_t pid const struct iovec *lvec unsigned long liovcnt const struct iovec *rvec unsigned long riovcnt unsigned long flags
311 sys_process_vm_writev pid_t pid const struct iovec *lvec unsigned long liovcnt const struct iovcc *rvec unsigned long riovcnt unsigned long flags
312 sys_kcmp pid_t pid1 pid_t pid2 int type unsigned long idx1 unsigned long idx2
313 sys_finit_module int fd const char __user *uargs int flags
314 sys_sched_setattr pid_t pid struct sched_attr __user *attr unsigned int flags
315 sys_sched_getattr pid_t pid struct sched_attr __user *attr unsigned int size unsigned int flags
316 sys_renameat2 int olddfd const char __user *oldname int newdfd const char __user *newname unsigned int flags
317 sys_seccomp unsigned int op unsigned int flags const char __user *uargs
318 sys_getrandom char __user *buf size_t count unsigned int flags
319 sys_memfd_create const char __user *uname_ptr unsigned int flags
320 sys_kexec_file_load int kernel_fd int initrd_fd unsigned long cmdline_len const char __user *cmdline_ptr unsigned long flags
321 sys_bpf int cmd union bpf_attr *attr unsigned int size
322 stub_execveat int dfd const char __user *filename const char user *const user *argv const char user *const user *envp int flags
323 userfaultfd int flags
324 membarrier int cmd int flags
325 mlock2 unsigned long start size_t len int flags
326 copy_file_range int fd_in loff_t __user *off_in int fd_out loff_t __user * off_out size_t len unsigned int flags
327 preadv2 unsigned long fd const struct iovec __user *vec unsigned long vlen unsigned long pos_l unsigned long pos_h int flags
328 pwritev2 unsigned long fd const struct iovec __user *vec unsigned long vlen unsigned long pos_l unsigned long pos_h int flags