blob: a26415b5151ce1866e805129de53331c76724813 [file] [log] [blame]
David Howells8a1ab312012-10-04 18:20:15 +01001#include <asm/bitsperlong.h>
2
3/*
4 * This file contains the system call numbers, based on the
5 * layout of the x86-64 architecture, which embeds the
6 * pointer to the syscall in the table.
7 *
8 * As a basic principle, no duplication of functionality
9 * should be added, e.g. we don't use lseek when llseek
10 * is present. New architectures should use this file
11 * and implement the less feature-full calls in user space.
12 */
13
14#ifndef __SYSCALL
15#define __SYSCALL(x, y)
16#endif
17
18#if __BITS_PER_LONG == 32 || defined(__SYSCALL_COMPAT)
19#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _32)
20#else
21#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64)
22#endif
23
24#ifdef __SYSCALL_COMPAT
25#define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _comp)
26#define __SC_COMP_3264(_nr, _32, _64, _comp) __SYSCALL(_nr, _comp)
27#else
28#define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys)
29#define __SC_COMP_3264(_nr, _32, _64, _comp) __SC_3264(_nr, _32, _64)
30#endif
31
32#define __NR_io_setup 0
33__SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
34#define __NR_io_destroy 1
35__SYSCALL(__NR_io_destroy, sys_io_destroy)
36#define __NR_io_submit 2
37__SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit)
38#define __NR_io_cancel 3
39__SYSCALL(__NR_io_cancel, sys_io_cancel)
40#define __NR_io_getevents 4
41__SC_COMP(__NR_io_getevents, sys_io_getevents, compat_sys_io_getevents)
42
43/* fs/xattr.c */
44#define __NR_setxattr 5
45__SYSCALL(__NR_setxattr, sys_setxattr)
46#define __NR_lsetxattr 6
47__SYSCALL(__NR_lsetxattr, sys_lsetxattr)
48#define __NR_fsetxattr 7
49__SYSCALL(__NR_fsetxattr, sys_fsetxattr)
50#define __NR_getxattr 8
51__SYSCALL(__NR_getxattr, sys_getxattr)
52#define __NR_lgetxattr 9
53__SYSCALL(__NR_lgetxattr, sys_lgetxattr)
54#define __NR_fgetxattr 10
55__SYSCALL(__NR_fgetxattr, sys_fgetxattr)
56#define __NR_listxattr 11
57__SYSCALL(__NR_listxattr, sys_listxattr)
58#define __NR_llistxattr 12
59__SYSCALL(__NR_llistxattr, sys_llistxattr)
60#define __NR_flistxattr 13
61__SYSCALL(__NR_flistxattr, sys_flistxattr)
62#define __NR_removexattr 14
63__SYSCALL(__NR_removexattr, sys_removexattr)
64#define __NR_lremovexattr 15
65__SYSCALL(__NR_lremovexattr, sys_lremovexattr)
66#define __NR_fremovexattr 16
67__SYSCALL(__NR_fremovexattr, sys_fremovexattr)
68
69/* fs/dcache.c */
70#define __NR_getcwd 17
71__SYSCALL(__NR_getcwd, sys_getcwd)
72
73/* fs/cookies.c */
74#define __NR_lookup_dcookie 18
75__SC_COMP(__NR_lookup_dcookie, sys_lookup_dcookie, compat_sys_lookup_dcookie)
76
77/* fs/eventfd.c */
78#define __NR_eventfd2 19
79__SYSCALL(__NR_eventfd2, sys_eventfd2)
80
81/* fs/eventpoll.c */
82#define __NR_epoll_create1 20
83__SYSCALL(__NR_epoll_create1, sys_epoll_create1)
84#define __NR_epoll_ctl 21
85__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
86#define __NR_epoll_pwait 22
87__SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait)
88
89/* fs/fcntl.c */
90#define __NR_dup 23
91__SYSCALL(__NR_dup, sys_dup)
92#define __NR_dup3 24
93__SYSCALL(__NR_dup3, sys_dup3)
94#define __NR3264_fcntl 25
95__SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64)
96
97/* fs/inotify_user.c */
98#define __NR_inotify_init1 26
99__SYSCALL(__NR_inotify_init1, sys_inotify_init1)
100#define __NR_inotify_add_watch 27
101__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
102#define __NR_inotify_rm_watch 28
103__SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
104
105/* fs/ioctl.c */
106#define __NR_ioctl 29
107__SC_COMP(__NR_ioctl, sys_ioctl, compat_sys_ioctl)
108
109/* fs/ioprio.c */
110#define __NR_ioprio_set 30
111__SYSCALL(__NR_ioprio_set, sys_ioprio_set)
112#define __NR_ioprio_get 31
113__SYSCALL(__NR_ioprio_get, sys_ioprio_get)
114
115/* fs/locks.c */
116#define __NR_flock 32
117__SYSCALL(__NR_flock, sys_flock)
118
119/* fs/namei.c */
120#define __NR_mknodat 33
121__SYSCALL(__NR_mknodat, sys_mknodat)
122#define __NR_mkdirat 34
123__SYSCALL(__NR_mkdirat, sys_mkdirat)
124#define __NR_unlinkat 35
125__SYSCALL(__NR_unlinkat, sys_unlinkat)
126#define __NR_symlinkat 36
127__SYSCALL(__NR_symlinkat, sys_symlinkat)
128#define __NR_linkat 37
129__SYSCALL(__NR_linkat, sys_linkat)
James Hoganb0da6d42016-04-29 22:29:26 +0100130#ifdef __ARCH_WANT_RENAMEAT
131/* renameat is superseded with flags by renameat2 */
David Howells8a1ab312012-10-04 18:20:15 +0100132#define __NR_renameat 38
133__SYSCALL(__NR_renameat, sys_renameat)
James Hoganb0da6d42016-04-29 22:29:26 +0100134#endif /* __ARCH_WANT_RENAMEAT */
David Howells8a1ab312012-10-04 18:20:15 +0100135
136/* fs/namespace.c */
137#define __NR_umount2 39
138__SYSCALL(__NR_umount2, sys_umount)
139#define __NR_mount 40
140__SC_COMP(__NR_mount, sys_mount, compat_sys_mount)
141#define __NR_pivot_root 41
142__SYSCALL(__NR_pivot_root, sys_pivot_root)
143
144/* fs/nfsctl.c */
145#define __NR_nfsservctl 42
146__SYSCALL(__NR_nfsservctl, sys_ni_syscall)
147
148/* fs/open.c */
149#define __NR3264_statfs 43
150__SC_COMP_3264(__NR3264_statfs, sys_statfs64, sys_statfs, \
151 compat_sys_statfs64)
152#define __NR3264_fstatfs 44
153__SC_COMP_3264(__NR3264_fstatfs, sys_fstatfs64, sys_fstatfs, \
154 compat_sys_fstatfs64)
155#define __NR3264_truncate 45
156__SC_COMP_3264(__NR3264_truncate, sys_truncate64, sys_truncate, \
157 compat_sys_truncate64)
158#define __NR3264_ftruncate 46
159__SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \
160 compat_sys_ftruncate64)
161
162#define __NR_fallocate 47
163__SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate)
164#define __NR_faccessat 48
165__SYSCALL(__NR_faccessat, sys_faccessat)
166#define __NR_chdir 49
167__SYSCALL(__NR_chdir, sys_chdir)
168#define __NR_fchdir 50
169__SYSCALL(__NR_fchdir, sys_fchdir)
170#define __NR_chroot 51
171__SYSCALL(__NR_chroot, sys_chroot)
172#define __NR_fchmod 52
173__SYSCALL(__NR_fchmod, sys_fchmod)
174#define __NR_fchmodat 53
175__SYSCALL(__NR_fchmodat, sys_fchmodat)
176#define __NR_fchownat 54
177__SYSCALL(__NR_fchownat, sys_fchownat)
178#define __NR_fchown 55
179__SYSCALL(__NR_fchown, sys_fchown)
180#define __NR_openat 56
181__SC_COMP(__NR_openat, sys_openat, compat_sys_openat)
182#define __NR_close 57
183__SYSCALL(__NR_close, sys_close)
184#define __NR_vhangup 58
185__SYSCALL(__NR_vhangup, sys_vhangup)
186
187/* fs/pipe.c */
188#define __NR_pipe2 59
189__SYSCALL(__NR_pipe2, sys_pipe2)
190
191/* fs/quota.c */
192#define __NR_quotactl 60
193__SYSCALL(__NR_quotactl, sys_quotactl)
194
195/* fs/readdir.c */
196#define __NR_getdents64 61
Heiko Carstens0473c9b2014-03-03 10:44:03 +0100197#define __ARCH_WANT_COMPAT_SYS_GETDENTS64
David Howells8a1ab312012-10-04 18:20:15 +0100198__SC_COMP(__NR_getdents64, sys_getdents64, compat_sys_getdents64)
199
200/* fs/read_write.c */
201#define __NR3264_lseek 62
202__SC_3264(__NR3264_lseek, sys_llseek, sys_lseek)
203#define __NR_read 63
204__SYSCALL(__NR_read, sys_read)
205#define __NR_write 64
206__SYSCALL(__NR_write, sys_write)
207#define __NR_readv 65
208__SC_COMP(__NR_readv, sys_readv, compat_sys_readv)
209#define __NR_writev 66
210__SC_COMP(__NR_writev, sys_writev, compat_sys_writev)
211#define __NR_pread64 67
212__SC_COMP(__NR_pread64, sys_pread64, compat_sys_pread64)
213#define __NR_pwrite64 68
214__SC_COMP(__NR_pwrite64, sys_pwrite64, compat_sys_pwrite64)
215#define __NR_preadv 69
216__SC_COMP(__NR_preadv, sys_preadv, compat_sys_preadv)
217#define __NR_pwritev 70
218__SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev)
219
220/* fs/sendfile.c */
221#define __NR3264_sendfile 71
222__SYSCALL(__NR3264_sendfile, sys_sendfile64)
223
224/* fs/select.c */
225#define __NR_pselect6 72
226__SC_COMP(__NR_pselect6, sys_pselect6, compat_sys_pselect6)
227#define __NR_ppoll 73
228__SC_COMP(__NR_ppoll, sys_ppoll, compat_sys_ppoll)
229
230/* fs/signalfd.c */
231#define __NR_signalfd4 74
232__SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4)
233
234/* fs/splice.c */
235#define __NR_vmsplice 75
236__SC_COMP(__NR_vmsplice, sys_vmsplice, compat_sys_vmsplice)
237#define __NR_splice 76
238__SYSCALL(__NR_splice, sys_splice)
239#define __NR_tee 77
240__SYSCALL(__NR_tee, sys_tee)
241
242/* fs/stat.c */
243#define __NR_readlinkat 78
244__SYSCALL(__NR_readlinkat, sys_readlinkat)
245#define __NR3264_fstatat 79
246__SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
247#define __NR3264_fstat 80
248__SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat)
249
250/* fs/sync.c */
251#define __NR_sync 81
252__SYSCALL(__NR_sync, sys_sync)
253#define __NR_fsync 82
254__SYSCALL(__NR_fsync, sys_fsync)
255#define __NR_fdatasync 83
256__SYSCALL(__NR_fdatasync, sys_fdatasync)
257#ifdef __ARCH_WANT_SYNC_FILE_RANGE2
258#define __NR_sync_file_range2 84
259__SC_COMP(__NR_sync_file_range2, sys_sync_file_range2, \
260 compat_sys_sync_file_range2)
261#else
262#define __NR_sync_file_range 84
263__SC_COMP(__NR_sync_file_range, sys_sync_file_range, \
264 compat_sys_sync_file_range)
265#endif
266
267/* fs/timerfd.c */
268#define __NR_timerfd_create 85
269__SYSCALL(__NR_timerfd_create, sys_timerfd_create)
270#define __NR_timerfd_settime 86
271__SC_COMP(__NR_timerfd_settime, sys_timerfd_settime, \
272 compat_sys_timerfd_settime)
273#define __NR_timerfd_gettime 87
274__SC_COMP(__NR_timerfd_gettime, sys_timerfd_gettime, \
275 compat_sys_timerfd_gettime)
276
277/* fs/utimes.c */
278#define __NR_utimensat 88
279__SC_COMP(__NR_utimensat, sys_utimensat, compat_sys_utimensat)
280
281/* kernel/acct.c */
282#define __NR_acct 89
283__SYSCALL(__NR_acct, sys_acct)
284
285/* kernel/capability.c */
286#define __NR_capget 90
287__SYSCALL(__NR_capget, sys_capget)
288#define __NR_capset 91
289__SYSCALL(__NR_capset, sys_capset)
290
291/* kernel/exec_domain.c */
292#define __NR_personality 92
293__SYSCALL(__NR_personality, sys_personality)
294
295/* kernel/exit.c */
296#define __NR_exit 93
297__SYSCALL(__NR_exit, sys_exit)
298#define __NR_exit_group 94
299__SYSCALL(__NR_exit_group, sys_exit_group)
300#define __NR_waitid 95
301__SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid)
302
303/* kernel/fork.c */
304#define __NR_set_tid_address 96
305__SYSCALL(__NR_set_tid_address, sys_set_tid_address)
306#define __NR_unshare 97
307__SYSCALL(__NR_unshare, sys_unshare)
308
309/* kernel/futex.c */
310#define __NR_futex 98
311__SC_COMP(__NR_futex, sys_futex, compat_sys_futex)
312#define __NR_set_robust_list 99
313__SC_COMP(__NR_set_robust_list, sys_set_robust_list, \
314 compat_sys_set_robust_list)
315#define __NR_get_robust_list 100
316__SC_COMP(__NR_get_robust_list, sys_get_robust_list, \
317 compat_sys_get_robust_list)
318
319/* kernel/hrtimer.c */
320#define __NR_nanosleep 101
321__SC_COMP(__NR_nanosleep, sys_nanosleep, compat_sys_nanosleep)
322
323/* kernel/itimer.c */
324#define __NR_getitimer 102
325__SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer)
326#define __NR_setitimer 103
327__SC_COMP(__NR_setitimer, sys_setitimer, compat_sys_setitimer)
328
329/* kernel/kexec.c */
330#define __NR_kexec_load 104
331__SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load)
332
333/* kernel/module.c */
334#define __NR_init_module 105
335__SYSCALL(__NR_init_module, sys_init_module)
336#define __NR_delete_module 106
337__SYSCALL(__NR_delete_module, sys_delete_module)
338
339/* kernel/posix-timers.c */
340#define __NR_timer_create 107
341__SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create)
342#define __NR_timer_gettime 108
343__SC_COMP(__NR_timer_gettime, sys_timer_gettime, compat_sys_timer_gettime)
344#define __NR_timer_getoverrun 109
345__SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun)
346#define __NR_timer_settime 110
347__SC_COMP(__NR_timer_settime, sys_timer_settime, compat_sys_timer_settime)
348#define __NR_timer_delete 111
349__SYSCALL(__NR_timer_delete, sys_timer_delete)
350#define __NR_clock_settime 112
351__SC_COMP(__NR_clock_settime, sys_clock_settime, compat_sys_clock_settime)
352#define __NR_clock_gettime 113
353__SC_COMP(__NR_clock_gettime, sys_clock_gettime, compat_sys_clock_gettime)
354#define __NR_clock_getres 114
355__SC_COMP(__NR_clock_getres, sys_clock_getres, compat_sys_clock_getres)
356#define __NR_clock_nanosleep 115
357__SC_COMP(__NR_clock_nanosleep, sys_clock_nanosleep, \
358 compat_sys_clock_nanosleep)
359
360/* kernel/printk.c */
361#define __NR_syslog 116
362__SYSCALL(__NR_syslog, sys_syslog)
363
364/* kernel/ptrace.c */
365#define __NR_ptrace 117
366__SYSCALL(__NR_ptrace, sys_ptrace)
367
Viresh Kumar0a0fca92013-06-04 13:10:24 +0530368/* kernel/sched/core.c */
David Howells8a1ab312012-10-04 18:20:15 +0100369#define __NR_sched_setparam 118
370__SYSCALL(__NR_sched_setparam, sys_sched_setparam)
371#define __NR_sched_setscheduler 119
372__SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler)
373#define __NR_sched_getscheduler 120
374__SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler)
375#define __NR_sched_getparam 121
376__SYSCALL(__NR_sched_getparam, sys_sched_getparam)
377#define __NR_sched_setaffinity 122
378__SC_COMP(__NR_sched_setaffinity, sys_sched_setaffinity, \
379 compat_sys_sched_setaffinity)
380#define __NR_sched_getaffinity 123
381__SC_COMP(__NR_sched_getaffinity, sys_sched_getaffinity, \
382 compat_sys_sched_getaffinity)
383#define __NR_sched_yield 124
384__SYSCALL(__NR_sched_yield, sys_sched_yield)
385#define __NR_sched_get_priority_max 125
386__SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max)
387#define __NR_sched_get_priority_min 126
388__SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min)
389#define __NR_sched_rr_get_interval 127
390__SC_COMP(__NR_sched_rr_get_interval, sys_sched_rr_get_interval, \
391 compat_sys_sched_rr_get_interval)
392
393/* kernel/signal.c */
394#define __NR_restart_syscall 128
395__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
396#define __NR_kill 129
397__SYSCALL(__NR_kill, sys_kill)
398#define __NR_tkill 130
399__SYSCALL(__NR_tkill, sys_tkill)
400#define __NR_tgkill 131
401__SYSCALL(__NR_tgkill, sys_tgkill)
402#define __NR_sigaltstack 132
403__SC_COMP(__NR_sigaltstack, sys_sigaltstack, compat_sys_sigaltstack)
404#define __NR_rt_sigsuspend 133
405__SC_COMP(__NR_rt_sigsuspend, sys_rt_sigsuspend, compat_sys_rt_sigsuspend)
406#define __NR_rt_sigaction 134
407__SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction)
408#define __NR_rt_sigprocmask 135
Al Viro03e27592012-12-25 13:58:56 -0500409__SC_COMP(__NR_rt_sigprocmask, sys_rt_sigprocmask, compat_sys_rt_sigprocmask)
David Howells8a1ab312012-10-04 18:20:15 +0100410#define __NR_rt_sigpending 136
Al Viro03e27592012-12-25 13:58:56 -0500411__SC_COMP(__NR_rt_sigpending, sys_rt_sigpending, compat_sys_rt_sigpending)
David Howells8a1ab312012-10-04 18:20:15 +0100412#define __NR_rt_sigtimedwait 137
413__SC_COMP(__NR_rt_sigtimedwait, sys_rt_sigtimedwait, \
414 compat_sys_rt_sigtimedwait)
415#define __NR_rt_sigqueueinfo 138
416__SC_COMP(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo, \
417 compat_sys_rt_sigqueueinfo)
418#define __NR_rt_sigreturn 139
419__SC_COMP(__NR_rt_sigreturn, sys_rt_sigreturn, compat_sys_rt_sigreturn)
420
421/* kernel/sys.c */
422#define __NR_setpriority 140
423__SYSCALL(__NR_setpriority, sys_setpriority)
424#define __NR_getpriority 141
425__SYSCALL(__NR_getpriority, sys_getpriority)
426#define __NR_reboot 142
427__SYSCALL(__NR_reboot, sys_reboot)
428#define __NR_setregid 143
429__SYSCALL(__NR_setregid, sys_setregid)
430#define __NR_setgid 144
431__SYSCALL(__NR_setgid, sys_setgid)
432#define __NR_setreuid 145
433__SYSCALL(__NR_setreuid, sys_setreuid)
434#define __NR_setuid 146
435__SYSCALL(__NR_setuid, sys_setuid)
436#define __NR_setresuid 147
437__SYSCALL(__NR_setresuid, sys_setresuid)
438#define __NR_getresuid 148
439__SYSCALL(__NR_getresuid, sys_getresuid)
440#define __NR_setresgid 149
441__SYSCALL(__NR_setresgid, sys_setresgid)
442#define __NR_getresgid 150
443__SYSCALL(__NR_getresgid, sys_getresgid)
444#define __NR_setfsuid 151
445__SYSCALL(__NR_setfsuid, sys_setfsuid)
446#define __NR_setfsgid 152
447__SYSCALL(__NR_setfsgid, sys_setfsgid)
448#define __NR_times 153
449__SC_COMP(__NR_times, sys_times, compat_sys_times)
450#define __NR_setpgid 154
451__SYSCALL(__NR_setpgid, sys_setpgid)
452#define __NR_getpgid 155
453__SYSCALL(__NR_getpgid, sys_getpgid)
454#define __NR_getsid 156
455__SYSCALL(__NR_getsid, sys_getsid)
456#define __NR_setsid 157
457__SYSCALL(__NR_setsid, sys_setsid)
458#define __NR_getgroups 158
459__SYSCALL(__NR_getgroups, sys_getgroups)
460#define __NR_setgroups 159
461__SYSCALL(__NR_setgroups, sys_setgroups)
462#define __NR_uname 160
463__SYSCALL(__NR_uname, sys_newuname)
464#define __NR_sethostname 161
465__SYSCALL(__NR_sethostname, sys_sethostname)
466#define __NR_setdomainname 162
467__SYSCALL(__NR_setdomainname, sys_setdomainname)
468#define __NR_getrlimit 163
469__SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
470#define __NR_setrlimit 164
471__SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit)
472#define __NR_getrusage 165
473__SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
474#define __NR_umask 166
475__SYSCALL(__NR_umask, sys_umask)
476#define __NR_prctl 167
477__SYSCALL(__NR_prctl, sys_prctl)
478#define __NR_getcpu 168
479__SYSCALL(__NR_getcpu, sys_getcpu)
480
481/* kernel/time.c */
482#define __NR_gettimeofday 169
483__SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday)
484#define __NR_settimeofday 170
485__SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday)
486#define __NR_adjtimex 171
487__SC_COMP(__NR_adjtimex, sys_adjtimex, compat_sys_adjtimex)
488
489/* kernel/timer.c */
490#define __NR_getpid 172
491__SYSCALL(__NR_getpid, sys_getpid)
492#define __NR_getppid 173
493__SYSCALL(__NR_getppid, sys_getppid)
494#define __NR_getuid 174
495__SYSCALL(__NR_getuid, sys_getuid)
496#define __NR_geteuid 175
497__SYSCALL(__NR_geteuid, sys_geteuid)
498#define __NR_getgid 176
499__SYSCALL(__NR_getgid, sys_getgid)
500#define __NR_getegid 177
501__SYSCALL(__NR_getegid, sys_getegid)
502#define __NR_gettid 178
503__SYSCALL(__NR_gettid, sys_gettid)
504#define __NR_sysinfo 179
505__SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo)
506
507/* ipc/mqueue.c */
508#define __NR_mq_open 180
509__SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open)
510#define __NR_mq_unlink 181
511__SYSCALL(__NR_mq_unlink, sys_mq_unlink)
512#define __NR_mq_timedsend 182
513__SC_COMP(__NR_mq_timedsend, sys_mq_timedsend, compat_sys_mq_timedsend)
514#define __NR_mq_timedreceive 183
515__SC_COMP(__NR_mq_timedreceive, sys_mq_timedreceive, \
516 compat_sys_mq_timedreceive)
517#define __NR_mq_notify 184
518__SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify)
519#define __NR_mq_getsetattr 185
520__SC_COMP(__NR_mq_getsetattr, sys_mq_getsetattr, compat_sys_mq_getsetattr)
521
522/* ipc/msg.c */
523#define __NR_msgget 186
524__SYSCALL(__NR_msgget, sys_msgget)
525#define __NR_msgctl 187
526__SC_COMP(__NR_msgctl, sys_msgctl, compat_sys_msgctl)
527#define __NR_msgrcv 188
528__SC_COMP(__NR_msgrcv, sys_msgrcv, compat_sys_msgrcv)
529#define __NR_msgsnd 189
530__SC_COMP(__NR_msgsnd, sys_msgsnd, compat_sys_msgsnd)
531
532/* ipc/sem.c */
533#define __NR_semget 190
534__SYSCALL(__NR_semget, sys_semget)
535#define __NR_semctl 191
536__SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl)
537#define __NR_semtimedop 192
538__SC_COMP(__NR_semtimedop, sys_semtimedop, compat_sys_semtimedop)
539#define __NR_semop 193
540__SYSCALL(__NR_semop, sys_semop)
541
542/* ipc/shm.c */
543#define __NR_shmget 194
544__SYSCALL(__NR_shmget, sys_shmget)
545#define __NR_shmctl 195
546__SC_COMP(__NR_shmctl, sys_shmctl, compat_sys_shmctl)
547#define __NR_shmat 196
548__SC_COMP(__NR_shmat, sys_shmat, compat_sys_shmat)
549#define __NR_shmdt 197
550__SYSCALL(__NR_shmdt, sys_shmdt)
551
552/* net/socket.c */
553#define __NR_socket 198
554__SYSCALL(__NR_socket, sys_socket)
555#define __NR_socketpair 199
556__SYSCALL(__NR_socketpair, sys_socketpair)
557#define __NR_bind 200
558__SYSCALL(__NR_bind, sys_bind)
559#define __NR_listen 201
560__SYSCALL(__NR_listen, sys_listen)
561#define __NR_accept 202
562__SYSCALL(__NR_accept, sys_accept)
563#define __NR_connect 203
564__SYSCALL(__NR_connect, sys_connect)
565#define __NR_getsockname 204
566__SYSCALL(__NR_getsockname, sys_getsockname)
567#define __NR_getpeername 205
568__SYSCALL(__NR_getpeername, sys_getpeername)
569#define __NR_sendto 206
570__SYSCALL(__NR_sendto, sys_sendto)
571#define __NR_recvfrom 207
572__SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom)
573#define __NR_setsockopt 208
574__SC_COMP(__NR_setsockopt, sys_setsockopt, compat_sys_setsockopt)
575#define __NR_getsockopt 209
576__SC_COMP(__NR_getsockopt, sys_getsockopt, compat_sys_getsockopt)
577#define __NR_shutdown 210
578__SYSCALL(__NR_shutdown, sys_shutdown)
579#define __NR_sendmsg 211
580__SC_COMP(__NR_sendmsg, sys_sendmsg, compat_sys_sendmsg)
581#define __NR_recvmsg 212
582__SC_COMP(__NR_recvmsg, sys_recvmsg, compat_sys_recvmsg)
583
584/* mm/filemap.c */
585#define __NR_readahead 213
586__SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead)
587
588/* mm/nommu.c, also with MMU */
589#define __NR_brk 214
590__SYSCALL(__NR_brk, sys_brk)
591#define __NR_munmap 215
592__SYSCALL(__NR_munmap, sys_munmap)
593#define __NR_mremap 216
594__SYSCALL(__NR_mremap, sys_mremap)
595
596/* security/keys/keyctl.c */
597#define __NR_add_key 217
598__SYSCALL(__NR_add_key, sys_add_key)
599#define __NR_request_key 218
600__SYSCALL(__NR_request_key, sys_request_key)
601#define __NR_keyctl 219
602__SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl)
603
604/* arch/example/kernel/sys_example.c */
605#define __NR_clone 220
606__SYSCALL(__NR_clone, sys_clone)
607#define __NR_execve 221
608__SC_COMP(__NR_execve, sys_execve, compat_sys_execve)
609
610#define __NR3264_mmap 222
611__SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap)
612/* mm/fadvise.c */
613#define __NR3264_fadvise64 223
614__SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64)
615
616/* mm/, CONFIG_MMU only */
617#ifndef __ARCH_NOMMU
618#define __NR_swapon 224
619__SYSCALL(__NR_swapon, sys_swapon)
620#define __NR_swapoff 225
621__SYSCALL(__NR_swapoff, sys_swapoff)
622#define __NR_mprotect 226
623__SYSCALL(__NR_mprotect, sys_mprotect)
624#define __NR_msync 227
625__SYSCALL(__NR_msync, sys_msync)
626#define __NR_mlock 228
627__SYSCALL(__NR_mlock, sys_mlock)
628#define __NR_munlock 229
629__SYSCALL(__NR_munlock, sys_munlock)
630#define __NR_mlockall 230
631__SYSCALL(__NR_mlockall, sys_mlockall)
632#define __NR_munlockall 231
633__SYSCALL(__NR_munlockall, sys_munlockall)
634#define __NR_mincore 232
635__SYSCALL(__NR_mincore, sys_mincore)
636#define __NR_madvise 233
637__SYSCALL(__NR_madvise, sys_madvise)
638#define __NR_remap_file_pages 234
639__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
640#define __NR_mbind 235
641__SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind)
642#define __NR_get_mempolicy 236
643__SC_COMP(__NR_get_mempolicy, sys_get_mempolicy, compat_sys_get_mempolicy)
644#define __NR_set_mempolicy 237
645__SC_COMP(__NR_set_mempolicy, sys_set_mempolicy, compat_sys_set_mempolicy)
646#define __NR_migrate_pages 238
647__SC_COMP(__NR_migrate_pages, sys_migrate_pages, compat_sys_migrate_pages)
648#define __NR_move_pages 239
649__SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages)
650#endif
651
652#define __NR_rt_tgsigqueueinfo 240
653__SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \
654 compat_sys_rt_tgsigqueueinfo)
655#define __NR_perf_event_open 241
656__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
657#define __NR_accept4 242
658__SYSCALL(__NR_accept4, sys_accept4)
659#define __NR_recvmmsg 243
660__SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)
661
662/*
663 * Architectures may provide up to 16 syscalls of their own
664 * starting with this value.
665 */
666#define __NR_arch_specific_syscall 244
667
668#define __NR_wait4 260
669__SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4)
670#define __NR_prlimit64 261
671__SYSCALL(__NR_prlimit64, sys_prlimit64)
672#define __NR_fanotify_init 262
673__SYSCALL(__NR_fanotify_init, sys_fanotify_init)
674#define __NR_fanotify_mark 263
675__SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
676#define __NR_name_to_handle_at 264
677__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
678#define __NR_open_by_handle_at 265
679__SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \
680 compat_sys_open_by_handle_at)
681#define __NR_clock_adjtime 266
682__SC_COMP(__NR_clock_adjtime, sys_clock_adjtime, compat_sys_clock_adjtime)
683#define __NR_syncfs 267
684__SYSCALL(__NR_syncfs, sys_syncfs)
685#define __NR_setns 268
686__SYSCALL(__NR_setns, sys_setns)
687#define __NR_sendmmsg 269
688__SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg)
689#define __NR_process_vm_readv 270
690__SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \
691 compat_sys_process_vm_readv)
692#define __NR_process_vm_writev 271
693__SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \
694 compat_sys_process_vm_writev)
695#define __NR_kcmp 272
696__SYSCALL(__NR_kcmp, sys_kcmp)
Kees Cook1625cee2012-10-16 12:40:03 +1030697#define __NR_finit_module 273
698__SYSCALL(__NR_finit_module, sys_finit_module)
James Hogane6cfc022014-02-03 15:33:37 +0000699#define __NR_sched_setattr 274
700__SYSCALL(__NR_sched_setattr, sys_sched_setattr)
701#define __NR_sched_getattr 275
702__SYSCALL(__NR_sched_getattr, sys_sched_getattr)
James Hogan63ba6002014-04-23 11:08:05 +0100703#define __NR_renameat2 276
704__SYSCALL(__NR_renameat2, sys_renameat2)
Kees Cook48dc92b2014-06-25 16:08:24 -0700705#define __NR_seccomp 277
706__SYSCALL(__NR_seccomp, sys_seccomp)
Theodore Ts'oc6e9d6f2014-07-17 04:13:05 -0400707#define __NR_getrandom 278
708__SYSCALL(__NR_getrandom, sys_getrandom)
Will Deacon503e6632014-08-11 14:24:47 +0100709#define __NR_memfd_create 279
710__SYSCALL(__NR_memfd_create, sys_memfd_create)
Alexei Starovoitov749730c2014-09-26 00:16:58 -0700711#define __NR_bpf 280
712__SYSCALL(__NR_bpf, sys_bpf)
David Drysdale51f39a12014-12-12 16:57:29 -0800713#define __NR_execveat 281
714__SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat)
Dr. David Alan Gilbert09f72982015-09-22 14:59:09 -0700715#define __NR_userfaultfd 282
716__SYSCALL(__NR_userfaultfd, sys_userfaultfd)
717#define __NR_membarrier 283
Mathieu Desnoyers5b25b132015-09-11 13:07:39 -0700718__SYSCALL(__NR_membarrier, sys_membarrier)
Eric B Munsona8ca5d02015-11-05 18:51:33 -0800719#define __NR_mlock2 284
720__SYSCALL(__NR_mlock2, sys_mlock2)
Zach Brown29732932015-11-10 16:53:30 -0500721#define __NR_copy_file_range 285
722__SYSCALL(__NR_copy_file_range, sys_copy_file_range)
Andre Przywara987aedb2016-04-11 10:17:46 +0100723#define __NR_preadv2 286
Yury Norov1f93e9f2016-05-02 19:12:47 +0300724__SC_COMP(__NR_preadv2, sys_preadv2, compat_sys_preadv2)
Andre Przywara987aedb2016-04-11 10:17:46 +0100725#define __NR_pwritev2 287
Yury Norov1f93e9f2016-05-02 19:12:47 +0300726__SC_COMP(__NR_pwritev2, sys_pwritev2, compat_sys_pwritev2)
David Howells8a1ab312012-10-04 18:20:15 +0100727
728#undef __NR_syscalls
Andre Przywara987aedb2016-04-11 10:17:46 +0100729#define __NR_syscalls 288
David Howells8a1ab312012-10-04 18:20:15 +0100730
731/*
732 * All syscalls below here should go away really,
733 * these are provided for both review and as a porting
734 * help for the C library version.
Dr. David Alan Gilbert09f72982015-09-22 14:59:09 -0700735 *
David Howells8a1ab312012-10-04 18:20:15 +0100736 * Last chance: are any of these important enough to
737 * enable by default?
738 */
739#ifdef __ARCH_WANT_SYSCALL_NO_AT
740#define __NR_open 1024
741__SYSCALL(__NR_open, sys_open)
742#define __NR_link 1025
743__SYSCALL(__NR_link, sys_link)
744#define __NR_unlink 1026
745__SYSCALL(__NR_unlink, sys_unlink)
746#define __NR_mknod 1027
747__SYSCALL(__NR_mknod, sys_mknod)
748#define __NR_chmod 1028
749__SYSCALL(__NR_chmod, sys_chmod)
750#define __NR_chown 1029
751__SYSCALL(__NR_chown, sys_chown)
752#define __NR_mkdir 1030
753__SYSCALL(__NR_mkdir, sys_mkdir)
754#define __NR_rmdir 1031
755__SYSCALL(__NR_rmdir, sys_rmdir)
756#define __NR_lchown 1032
757__SYSCALL(__NR_lchown, sys_lchown)
758#define __NR_access 1033
759__SYSCALL(__NR_access, sys_access)
760#define __NR_rename 1034
761__SYSCALL(__NR_rename, sys_rename)
762#define __NR_readlink 1035
763__SYSCALL(__NR_readlink, sys_readlink)
764#define __NR_symlink 1036
765__SYSCALL(__NR_symlink, sys_symlink)
766#define __NR_utimes 1037
767__SYSCALL(__NR_utimes, sys_utimes)
768#define __NR3264_stat 1038
769__SC_3264(__NR3264_stat, sys_stat64, sys_newstat)
770#define __NR3264_lstat 1039
771__SC_3264(__NR3264_lstat, sys_lstat64, sys_newlstat)
772
773#undef __NR_syscalls
774#define __NR_syscalls (__NR3264_lstat+1)
775#endif /* __ARCH_WANT_SYSCALL_NO_AT */
776
777#ifdef __ARCH_WANT_SYSCALL_NO_FLAGS
778#define __NR_pipe 1040
779__SYSCALL(__NR_pipe, sys_pipe)
780#define __NR_dup2 1041
781__SYSCALL(__NR_dup2, sys_dup2)
782#define __NR_epoll_create 1042
783__SYSCALL(__NR_epoll_create, sys_epoll_create)
784#define __NR_inotify_init 1043
785__SYSCALL(__NR_inotify_init, sys_inotify_init)
786#define __NR_eventfd 1044
787__SYSCALL(__NR_eventfd, sys_eventfd)
788#define __NR_signalfd 1045
789__SYSCALL(__NR_signalfd, sys_signalfd)
790
791#undef __NR_syscalls
792#define __NR_syscalls (__NR_signalfd+1)
793#endif /* __ARCH_WANT_SYSCALL_NO_FLAGS */
794
795#if (__BITS_PER_LONG == 32 || defined(__SYSCALL_COMPAT)) && \
796 defined(__ARCH_WANT_SYSCALL_OFF_T)
797#define __NR_sendfile 1046
798__SYSCALL(__NR_sendfile, sys_sendfile)
799#define __NR_ftruncate 1047
800__SYSCALL(__NR_ftruncate, sys_ftruncate)
801#define __NR_truncate 1048
802__SYSCALL(__NR_truncate, sys_truncate)
803#define __NR_stat 1049
804__SYSCALL(__NR_stat, sys_newstat)
805#define __NR_lstat 1050
806__SYSCALL(__NR_lstat, sys_newlstat)
807#define __NR_fstat 1051
808__SYSCALL(__NR_fstat, sys_newfstat)
809#define __NR_fcntl 1052
810__SYSCALL(__NR_fcntl, sys_fcntl)
811#define __NR_fadvise64 1053
812#define __ARCH_WANT_SYS_FADVISE64
813__SYSCALL(__NR_fadvise64, sys_fadvise64)
814#define __NR_newfstatat 1054
815#define __ARCH_WANT_SYS_NEWFSTATAT
816__SYSCALL(__NR_newfstatat, sys_newfstatat)
817#define __NR_fstatfs 1055
818__SYSCALL(__NR_fstatfs, sys_fstatfs)
819#define __NR_statfs 1056
820__SYSCALL(__NR_statfs, sys_statfs)
821#define __NR_lseek 1057
822__SYSCALL(__NR_lseek, sys_lseek)
823#define __NR_mmap 1058
824__SYSCALL(__NR_mmap, sys_mmap)
825
826#undef __NR_syscalls
827#define __NR_syscalls (__NR_mmap+1)
828#endif /* 32 bit off_t syscalls */
829
830#ifdef __ARCH_WANT_SYSCALL_DEPRECATED
831#define __NR_alarm 1059
832#define __ARCH_WANT_SYS_ALARM
833__SYSCALL(__NR_alarm, sys_alarm)
834#define __NR_getpgrp 1060
835#define __ARCH_WANT_SYS_GETPGRP
836__SYSCALL(__NR_getpgrp, sys_getpgrp)
837#define __NR_pause 1061
838#define __ARCH_WANT_SYS_PAUSE
839__SYSCALL(__NR_pause, sys_pause)
840#define __NR_time 1062
841#define __ARCH_WANT_SYS_TIME
842#define __ARCH_WANT_COMPAT_SYS_TIME
843__SYSCALL(__NR_time, sys_time)
844#define __NR_utime 1063
845#define __ARCH_WANT_SYS_UTIME
846__SYSCALL(__NR_utime, sys_utime)
847
848#define __NR_creat 1064
849__SYSCALL(__NR_creat, sys_creat)
850#define __NR_getdents 1065
851#define __ARCH_WANT_SYS_GETDENTS
852__SYSCALL(__NR_getdents, sys_getdents)
853#define __NR_futimesat 1066
854__SYSCALL(__NR_futimesat, sys_futimesat)
855#define __NR_select 1067
856#define __ARCH_WANT_SYS_SELECT
857__SYSCALL(__NR_select, sys_select)
858#define __NR_poll 1068
859__SYSCALL(__NR_poll, sys_poll)
860#define __NR_epoll_wait 1069
861__SYSCALL(__NR_epoll_wait, sys_epoll_wait)
862#define __NR_ustat 1070
863__SYSCALL(__NR_ustat, sys_ustat)
864#define __NR_vfork 1071
865__SYSCALL(__NR_vfork, sys_vfork)
866#define __NR_oldwait4 1072
867__SYSCALL(__NR_oldwait4, sys_wait4)
868#define __NR_recv 1073
869__SYSCALL(__NR_recv, sys_recv)
870#define __NR_send 1074
871__SYSCALL(__NR_send, sys_send)
872#define __NR_bdflush 1075
873__SYSCALL(__NR_bdflush, sys_bdflush)
874#define __NR_umount 1076
875__SYSCALL(__NR_umount, sys_oldumount)
876#define __ARCH_WANT_SYS_OLDUMOUNT
877#define __NR_uselib 1077
878__SYSCALL(__NR_uselib, sys_uselib)
879#define __NR__sysctl 1078
880__SYSCALL(__NR__sysctl, sys_sysctl)
881
882#define __NR_fork 1079
883#ifdef CONFIG_MMU
884__SYSCALL(__NR_fork, sys_fork)
885#else
886__SYSCALL(__NR_fork, sys_ni_syscall)
887#endif /* CONFIG_MMU */
888
889#undef __NR_syscalls
890#define __NR_syscalls (__NR_fork+1)
891
892#endif /* __ARCH_WANT_SYSCALL_DEPRECATED */
893
894/*
895 * 32 bit systems traditionally used different
896 * syscalls for off_t and loff_t arguments, while
897 * 64 bit systems only need the off_t version.
898 * For new 32 bit platforms, there is no need to
899 * implement the old 32 bit off_t syscalls, so
900 * they take different names.
901 * Here we map the numbers so that both versions
902 * use the same syscall table layout.
903 */
904#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
905#define __NR_fcntl __NR3264_fcntl
906#define __NR_statfs __NR3264_statfs
907#define __NR_fstatfs __NR3264_fstatfs
908#define __NR_truncate __NR3264_truncate
909#define __NR_ftruncate __NR3264_ftruncate
910#define __NR_lseek __NR3264_lseek
911#define __NR_sendfile __NR3264_sendfile
912#define __NR_newfstatat __NR3264_fstatat
913#define __NR_fstat __NR3264_fstat
914#define __NR_mmap __NR3264_mmap
915#define __NR_fadvise64 __NR3264_fadvise64
916#ifdef __NR3264_stat
917#define __NR_stat __NR3264_stat
918#define __NR_lstat __NR3264_lstat
919#endif
920#else
921#define __NR_fcntl64 __NR3264_fcntl
922#define __NR_statfs64 __NR3264_statfs
923#define __NR_fstatfs64 __NR3264_fstatfs
924#define __NR_truncate64 __NR3264_truncate
925#define __NR_ftruncate64 __NR3264_ftruncate
926#define __NR_llseek __NR3264_lseek
927#define __NR_sendfile64 __NR3264_sendfile
928#define __NR_fstatat64 __NR3264_fstatat
929#define __NR_fstat64 __NR3264_fstat
930#define __NR_mmap2 __NR3264_mmap
931#define __NR_fadvise64_64 __NR3264_fadvise64
932#ifdef __NR3264_stat
933#define __NR_stat64 __NR3264_stat
934#define __NR_lstat64 __NR3264_lstat
935#endif
936#endif