blob: 2cdf600b05fabd2a0b8ab24c66698ca4c40666ac [file] [log] [blame]
Greg Kroah-Hartman6f52b162017-11-01 15:08:43 +01001/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
David Howells8a1ab312012-10-04 18:20:15 +01002#include <asm/bitsperlong.h>
3
4/*
5 * This file contains the system call numbers, based on the
6 * layout of the x86-64 architecture, which embeds the
7 * pointer to the syscall in the table.
8 *
9 * As a basic principle, no duplication of functionality
10 * should be added, e.g. we don't use lseek when llseek
11 * is present. New architectures should use this file
12 * and implement the less feature-full calls in user space.
13 */
14
15#ifndef __SYSCALL
16#define __SYSCALL(x, y)
17#endif
18
19#if __BITS_PER_LONG == 32 || defined(__SYSCALL_COMPAT)
20#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _32)
21#else
22#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64)
23#endif
24
25#ifdef __SYSCALL_COMPAT
26#define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _comp)
27#define __SC_COMP_3264(_nr, _32, _64, _comp) __SYSCALL(_nr, _comp)
28#else
29#define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys)
30#define __SC_COMP_3264(_nr, _32, _64, _comp) __SC_3264(_nr, _32, _64)
31#endif
32
33#define __NR_io_setup 0
34__SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
35#define __NR_io_destroy 1
36__SYSCALL(__NR_io_destroy, sys_io_destroy)
37#define __NR_io_submit 2
38__SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit)
39#define __NR_io_cancel 3
40__SYSCALL(__NR_io_cancel, sys_io_cancel)
41#define __NR_io_getevents 4
Arnd Bergmann00bf25d2019-01-01 01:13:32 +010042__SC_3264(__NR_io_getevents, sys_io_getevents_time32, sys_io_getevents)
David Howells8a1ab312012-10-04 18:20:15 +010043
44/* fs/xattr.c */
45#define __NR_setxattr 5
46__SYSCALL(__NR_setxattr, sys_setxattr)
47#define __NR_lsetxattr 6
48__SYSCALL(__NR_lsetxattr, sys_lsetxattr)
49#define __NR_fsetxattr 7
50__SYSCALL(__NR_fsetxattr, sys_fsetxattr)
51#define __NR_getxattr 8
52__SYSCALL(__NR_getxattr, sys_getxattr)
53#define __NR_lgetxattr 9
54__SYSCALL(__NR_lgetxattr, sys_lgetxattr)
55#define __NR_fgetxattr 10
56__SYSCALL(__NR_fgetxattr, sys_fgetxattr)
57#define __NR_listxattr 11
58__SYSCALL(__NR_listxattr, sys_listxattr)
59#define __NR_llistxattr 12
60__SYSCALL(__NR_llistxattr, sys_llistxattr)
61#define __NR_flistxattr 13
62__SYSCALL(__NR_flistxattr, sys_flistxattr)
63#define __NR_removexattr 14
64__SYSCALL(__NR_removexattr, sys_removexattr)
65#define __NR_lremovexattr 15
66__SYSCALL(__NR_lremovexattr, sys_lremovexattr)
67#define __NR_fremovexattr 16
68__SYSCALL(__NR_fremovexattr, sys_fremovexattr)
69
70/* fs/dcache.c */
71#define __NR_getcwd 17
72__SYSCALL(__NR_getcwd, sys_getcwd)
73
74/* fs/cookies.c */
75#define __NR_lookup_dcookie 18
76__SC_COMP(__NR_lookup_dcookie, sys_lookup_dcookie, compat_sys_lookup_dcookie)
77
78/* fs/eventfd.c */
79#define __NR_eventfd2 19
80__SYSCALL(__NR_eventfd2, sys_eventfd2)
81
82/* fs/eventpoll.c */
83#define __NR_epoll_create1 20
84__SYSCALL(__NR_epoll_create1, sys_epoll_create1)
85#define __NR_epoll_ctl 21
86__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
87#define __NR_epoll_pwait 22
88__SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait)
89
90/* fs/fcntl.c */
91#define __NR_dup 23
92__SYSCALL(__NR_dup, sys_dup)
93#define __NR_dup3 24
94__SYSCALL(__NR_dup3, sys_dup3)
95#define __NR3264_fcntl 25
96__SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64)
97
98/* fs/inotify_user.c */
99#define __NR_inotify_init1 26
100__SYSCALL(__NR_inotify_init1, sys_inotify_init1)
101#define __NR_inotify_add_watch 27
102__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
103#define __NR_inotify_rm_watch 28
104__SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
105
106/* fs/ioctl.c */
107#define __NR_ioctl 29
108__SC_COMP(__NR_ioctl, sys_ioctl, compat_sys_ioctl)
109
110/* fs/ioprio.c */
111#define __NR_ioprio_set 30
112__SYSCALL(__NR_ioprio_set, sys_ioprio_set)
113#define __NR_ioprio_get 31
114__SYSCALL(__NR_ioprio_get, sys_ioprio_get)
115
116/* fs/locks.c */
117#define __NR_flock 32
118__SYSCALL(__NR_flock, sys_flock)
119
120/* fs/namei.c */
121#define __NR_mknodat 33
122__SYSCALL(__NR_mknodat, sys_mknodat)
123#define __NR_mkdirat 34
124__SYSCALL(__NR_mkdirat, sys_mkdirat)
125#define __NR_unlinkat 35
126__SYSCALL(__NR_unlinkat, sys_unlinkat)
127#define __NR_symlinkat 36
128__SYSCALL(__NR_symlinkat, sys_symlinkat)
129#define __NR_linkat 37
130__SYSCALL(__NR_linkat, sys_linkat)
James Hoganb0da6d42016-04-29 22:29:26 +0100131#ifdef __ARCH_WANT_RENAMEAT
132/* renameat is superseded with flags by renameat2 */
David Howells8a1ab312012-10-04 18:20:15 +0100133#define __NR_renameat 38
134__SYSCALL(__NR_renameat, sys_renameat)
James Hoganb0da6d42016-04-29 22:29:26 +0100135#endif /* __ARCH_WANT_RENAMEAT */
David Howells8a1ab312012-10-04 18:20:15 +0100136
137/* fs/namespace.c */
138#define __NR_umount2 39
139__SYSCALL(__NR_umount2, sys_umount)
140#define __NR_mount 40
141__SC_COMP(__NR_mount, sys_mount, compat_sys_mount)
142#define __NR_pivot_root 41
143__SYSCALL(__NR_pivot_root, sys_pivot_root)
144
145/* fs/nfsctl.c */
146#define __NR_nfsservctl 42
147__SYSCALL(__NR_nfsservctl, sys_ni_syscall)
148
149/* fs/open.c */
150#define __NR3264_statfs 43
151__SC_COMP_3264(__NR3264_statfs, sys_statfs64, sys_statfs, \
152 compat_sys_statfs64)
153#define __NR3264_fstatfs 44
154__SC_COMP_3264(__NR3264_fstatfs, sys_fstatfs64, sys_fstatfs, \
155 compat_sys_fstatfs64)
156#define __NR3264_truncate 45
157__SC_COMP_3264(__NR3264_truncate, sys_truncate64, sys_truncate, \
158 compat_sys_truncate64)
159#define __NR3264_ftruncate 46
160__SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \
161 compat_sys_ftruncate64)
162
163#define __NR_fallocate 47
164__SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate)
165#define __NR_faccessat 48
166__SYSCALL(__NR_faccessat, sys_faccessat)
167#define __NR_chdir 49
168__SYSCALL(__NR_chdir, sys_chdir)
169#define __NR_fchdir 50
170__SYSCALL(__NR_fchdir, sys_fchdir)
171#define __NR_chroot 51
172__SYSCALL(__NR_chroot, sys_chroot)
173#define __NR_fchmod 52
174__SYSCALL(__NR_fchmod, sys_fchmod)
175#define __NR_fchmodat 53
176__SYSCALL(__NR_fchmodat, sys_fchmodat)
177#define __NR_fchownat 54
178__SYSCALL(__NR_fchownat, sys_fchownat)
179#define __NR_fchown 55
180__SYSCALL(__NR_fchown, sys_fchown)
181#define __NR_openat 56
Yury Norov0d0216c2018-05-16 11:18:48 +0300182__SYSCALL(__NR_openat, sys_openat)
David Howells8a1ab312012-10-04 18:20:15 +0100183#define __NR_close 57
184__SYSCALL(__NR_close, sys_close)
185#define __NR_vhangup 58
186__SYSCALL(__NR_vhangup, sys_vhangup)
187
188/* fs/pipe.c */
189#define __NR_pipe2 59
190__SYSCALL(__NR_pipe2, sys_pipe2)
191
192/* fs/quota.c */
193#define __NR_quotactl 60
194__SYSCALL(__NR_quotactl, sys_quotactl)
195
196/* fs/readdir.c */
197#define __NR_getdents64 61
Al Viro2611dc12017-04-08 14:34:51 -0400198__SYSCALL(__NR_getdents64, sys_getdents64)
David Howells8a1ab312012-10-04 18:20:15 +0100199
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
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100226__SC_COMP_3264(__NR_pselect6, sys_pselect6_time32, sys_pselect6, compat_sys_pselect6_time32)
David Howells8a1ab312012-10-04 18:20:15 +0100227#define __NR_ppoll 73
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100228__SC_COMP_3264(__NR_ppoll, sys_ppoll_time32, sys_ppoll, compat_sys_ppoll_time32)
David Howells8a1ab312012-10-04 18:20:15 +0100229
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)
Arnd Bergmannbf4b6a72018-04-13 12:19:47 +0200245#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
David Howells8a1ab312012-10-04 18:20:15 +0100246#define __NR3264_fstatat 79
247__SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
248#define __NR3264_fstat 80
249__SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat)
Arnd Bergmannbf4b6a72018-04-13 12:19:47 +0200250#endif
David Howells8a1ab312012-10-04 18:20:15 +0100251
252/* fs/sync.c */
253#define __NR_sync 81
254__SYSCALL(__NR_sync, sys_sync)
255#define __NR_fsync 82
256__SYSCALL(__NR_fsync, sys_fsync)
257#define __NR_fdatasync 83
258__SYSCALL(__NR_fdatasync, sys_fdatasync)
259#ifdef __ARCH_WANT_SYNC_FILE_RANGE2
260#define __NR_sync_file_range2 84
261__SC_COMP(__NR_sync_file_range2, sys_sync_file_range2, \
262 compat_sys_sync_file_range2)
263#else
264#define __NR_sync_file_range 84
265__SC_COMP(__NR_sync_file_range, sys_sync_file_range, \
266 compat_sys_sync_file_range)
267#endif
268
269/* fs/timerfd.c */
270#define __NR_timerfd_create 85
271__SYSCALL(__NR_timerfd_create, sys_timerfd_create)
272#define __NR_timerfd_settime 86
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100273__SC_3264(__NR_timerfd_settime, sys_timerfd_settime32, \
274 sys_timerfd_settime)
David Howells8a1ab312012-10-04 18:20:15 +0100275#define __NR_timerfd_gettime 87
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100276__SC_3264(__NR_timerfd_gettime, sys_timerfd_gettime32, \
277 sys_timerfd_gettime)
David Howells8a1ab312012-10-04 18:20:15 +0100278
279/* fs/utimes.c */
280#define __NR_utimensat 88
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100281__SC_3264(__NR_utimensat, sys_utimensat_time32, sys_utimensat)
David Howells8a1ab312012-10-04 18:20:15 +0100282
283/* kernel/acct.c */
284#define __NR_acct 89
285__SYSCALL(__NR_acct, sys_acct)
286
287/* kernel/capability.c */
288#define __NR_capget 90
289__SYSCALL(__NR_capget, sys_capget)
290#define __NR_capset 91
291__SYSCALL(__NR_capset, sys_capset)
292
293/* kernel/exec_domain.c */
294#define __NR_personality 92
295__SYSCALL(__NR_personality, sys_personality)
296
297/* kernel/exit.c */
298#define __NR_exit 93
299__SYSCALL(__NR_exit, sys_exit)
300#define __NR_exit_group 94
301__SYSCALL(__NR_exit_group, sys_exit_group)
302#define __NR_waitid 95
303__SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid)
304
305/* kernel/fork.c */
306#define __NR_set_tid_address 96
307__SYSCALL(__NR_set_tid_address, sys_set_tid_address)
308#define __NR_unshare 97
309__SYSCALL(__NR_unshare, sys_unshare)
310
311/* kernel/futex.c */
312#define __NR_futex 98
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100313__SC_3264(__NR_futex, sys_futex_time32, sys_futex)
David Howells8a1ab312012-10-04 18:20:15 +0100314#define __NR_set_robust_list 99
315__SC_COMP(__NR_set_robust_list, sys_set_robust_list, \
316 compat_sys_set_robust_list)
317#define __NR_get_robust_list 100
318__SC_COMP(__NR_get_robust_list, sys_get_robust_list, \
319 compat_sys_get_robust_list)
320
321/* kernel/hrtimer.c */
322#define __NR_nanosleep 101
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100323__SC_3264(__NR_nanosleep, sys_nanosleep_time32, sys_nanosleep)
David Howells8a1ab312012-10-04 18:20:15 +0100324
325/* kernel/itimer.c */
326#define __NR_getitimer 102
327__SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer)
328#define __NR_setitimer 103
329__SC_COMP(__NR_setitimer, sys_setitimer, compat_sys_setitimer)
330
331/* kernel/kexec.c */
332#define __NR_kexec_load 104
333__SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load)
334
335/* kernel/module.c */
336#define __NR_init_module 105
337__SYSCALL(__NR_init_module, sys_init_module)
338#define __NR_delete_module 106
339__SYSCALL(__NR_delete_module, sys_delete_module)
340
341/* kernel/posix-timers.c */
342#define __NR_timer_create 107
343__SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create)
344#define __NR_timer_gettime 108
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100345__SC_3264(__NR_timer_gettime, sys_timer_gettime32, sys_timer_gettime)
David Howells8a1ab312012-10-04 18:20:15 +0100346#define __NR_timer_getoverrun 109
347__SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun)
348#define __NR_timer_settime 110
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100349__SC_3264(__NR_timer_settime, sys_timer_settime32, sys_timer_settime)
David Howells8a1ab312012-10-04 18:20:15 +0100350#define __NR_timer_delete 111
351__SYSCALL(__NR_timer_delete, sys_timer_delete)
352#define __NR_clock_settime 112
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100353__SC_3264(__NR_clock_settime, sys_clock_settime32, sys_clock_settime)
David Howells8a1ab312012-10-04 18:20:15 +0100354#define __NR_clock_gettime 113
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100355__SC_3264(__NR_clock_gettime, sys_clock_gettime32, sys_clock_gettime)
David Howells8a1ab312012-10-04 18:20:15 +0100356#define __NR_clock_getres 114
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100357__SC_3264(__NR_clock_getres, sys_clock_getres_time32, sys_clock_getres)
David Howells8a1ab312012-10-04 18:20:15 +0100358#define __NR_clock_nanosleep 115
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100359__SC_3264(__NR_clock_nanosleep, sys_clock_nanosleep_time32, \
360 sys_clock_nanosleep)
David Howells8a1ab312012-10-04 18:20:15 +0100361
362/* kernel/printk.c */
363#define __NR_syslog 116
364__SYSCALL(__NR_syslog, sys_syslog)
365
366/* kernel/ptrace.c */
367#define __NR_ptrace 117
368__SYSCALL(__NR_ptrace, sys_ptrace)
369
Viresh Kumar0a0fca92013-06-04 13:10:24 +0530370/* kernel/sched/core.c */
David Howells8a1ab312012-10-04 18:20:15 +0100371#define __NR_sched_setparam 118
372__SYSCALL(__NR_sched_setparam, sys_sched_setparam)
373#define __NR_sched_setscheduler 119
374__SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler)
375#define __NR_sched_getscheduler 120
376__SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler)
377#define __NR_sched_getparam 121
378__SYSCALL(__NR_sched_getparam, sys_sched_getparam)
379#define __NR_sched_setaffinity 122
380__SC_COMP(__NR_sched_setaffinity, sys_sched_setaffinity, \
381 compat_sys_sched_setaffinity)
382#define __NR_sched_getaffinity 123
383__SC_COMP(__NR_sched_getaffinity, sys_sched_getaffinity, \
384 compat_sys_sched_getaffinity)
385#define __NR_sched_yield 124
386__SYSCALL(__NR_sched_yield, sys_sched_yield)
387#define __NR_sched_get_priority_max 125
388__SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max)
389#define __NR_sched_get_priority_min 126
390__SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min)
391#define __NR_sched_rr_get_interval 127
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100392__SC_3264(__NR_sched_rr_get_interval, sys_sched_rr_get_interval_time32, \
393 sys_sched_rr_get_interval)
David Howells8a1ab312012-10-04 18:20:15 +0100394
395/* kernel/signal.c */
396#define __NR_restart_syscall 128
397__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
398#define __NR_kill 129
399__SYSCALL(__NR_kill, sys_kill)
400#define __NR_tkill 130
401__SYSCALL(__NR_tkill, sys_tkill)
402#define __NR_tgkill 131
403__SYSCALL(__NR_tgkill, sys_tgkill)
404#define __NR_sigaltstack 132
405__SC_COMP(__NR_sigaltstack, sys_sigaltstack, compat_sys_sigaltstack)
406#define __NR_rt_sigsuspend 133
407__SC_COMP(__NR_rt_sigsuspend, sys_rt_sigsuspend, compat_sys_rt_sigsuspend)
408#define __NR_rt_sigaction 134
409__SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction)
410#define __NR_rt_sigprocmask 135
Al Viro03e27592012-12-25 13:58:56 -0500411__SC_COMP(__NR_rt_sigprocmask, sys_rt_sigprocmask, compat_sys_rt_sigprocmask)
David Howells8a1ab312012-10-04 18:20:15 +0100412#define __NR_rt_sigpending 136
Al Viro03e27592012-12-25 13:58:56 -0500413__SC_COMP(__NR_rt_sigpending, sys_rt_sigpending, compat_sys_rt_sigpending)
David Howells8a1ab312012-10-04 18:20:15 +0100414#define __NR_rt_sigtimedwait 137
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100415__SC_COMP_3264(__NR_rt_sigtimedwait, sys_rt_sigtimedwait_time32, \
416 sys_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time32)
David Howells8a1ab312012-10-04 18:20:15 +0100417#define __NR_rt_sigqueueinfo 138
418__SC_COMP(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo, \
419 compat_sys_rt_sigqueueinfo)
420#define __NR_rt_sigreturn 139
421__SC_COMP(__NR_rt_sigreturn, sys_rt_sigreturn, compat_sys_rt_sigreturn)
422
423/* kernel/sys.c */
424#define __NR_setpriority 140
425__SYSCALL(__NR_setpriority, sys_setpriority)
426#define __NR_getpriority 141
427__SYSCALL(__NR_getpriority, sys_getpriority)
428#define __NR_reboot 142
429__SYSCALL(__NR_reboot, sys_reboot)
430#define __NR_setregid 143
431__SYSCALL(__NR_setregid, sys_setregid)
432#define __NR_setgid 144
433__SYSCALL(__NR_setgid, sys_setgid)
434#define __NR_setreuid 145
435__SYSCALL(__NR_setreuid, sys_setreuid)
436#define __NR_setuid 146
437__SYSCALL(__NR_setuid, sys_setuid)
438#define __NR_setresuid 147
439__SYSCALL(__NR_setresuid, sys_setresuid)
440#define __NR_getresuid 148
441__SYSCALL(__NR_getresuid, sys_getresuid)
442#define __NR_setresgid 149
443__SYSCALL(__NR_setresgid, sys_setresgid)
444#define __NR_getresgid 150
445__SYSCALL(__NR_getresgid, sys_getresgid)
446#define __NR_setfsuid 151
447__SYSCALL(__NR_setfsuid, sys_setfsuid)
448#define __NR_setfsgid 152
449__SYSCALL(__NR_setfsgid, sys_setfsgid)
450#define __NR_times 153
451__SC_COMP(__NR_times, sys_times, compat_sys_times)
452#define __NR_setpgid 154
453__SYSCALL(__NR_setpgid, sys_setpgid)
454#define __NR_getpgid 155
455__SYSCALL(__NR_getpgid, sys_getpgid)
456#define __NR_getsid 156
457__SYSCALL(__NR_getsid, sys_getsid)
458#define __NR_setsid 157
459__SYSCALL(__NR_setsid, sys_setsid)
460#define __NR_getgroups 158
461__SYSCALL(__NR_getgroups, sys_getgroups)
462#define __NR_setgroups 159
463__SYSCALL(__NR_setgroups, sys_setgroups)
464#define __NR_uname 160
465__SYSCALL(__NR_uname, sys_newuname)
466#define __NR_sethostname 161
467__SYSCALL(__NR_sethostname, sys_sethostname)
468#define __NR_setdomainname 162
469__SYSCALL(__NR_setdomainname, sys_setdomainname)
Yury Norov80d7da12018-05-16 11:18:50 +0300470
471#ifdef __ARCH_WANT_SET_GET_RLIMIT
472/* getrlimit and setrlimit are superseded with prlimit64 */
David Howells8a1ab312012-10-04 18:20:15 +0100473#define __NR_getrlimit 163
474__SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
475#define __NR_setrlimit 164
476__SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit)
Yury Norov80d7da12018-05-16 11:18:50 +0300477#endif
478
David Howells8a1ab312012-10-04 18:20:15 +0100479#define __NR_getrusage 165
480__SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
481#define __NR_umask 166
482__SYSCALL(__NR_umask, sys_umask)
483#define __NR_prctl 167
484__SYSCALL(__NR_prctl, sys_prctl)
485#define __NR_getcpu 168
486__SYSCALL(__NR_getcpu, sys_getcpu)
487
488/* kernel/time.c */
489#define __NR_gettimeofday 169
490__SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday)
491#define __NR_settimeofday 170
492__SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday)
493#define __NR_adjtimex 171
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100494__SC_3264(__NR_adjtimex, sys_adjtimex_time32, sys_adjtimex)
David Howells8a1ab312012-10-04 18:20:15 +0100495
496/* kernel/timer.c */
497#define __NR_getpid 172
498__SYSCALL(__NR_getpid, sys_getpid)
499#define __NR_getppid 173
500__SYSCALL(__NR_getppid, sys_getppid)
501#define __NR_getuid 174
502__SYSCALL(__NR_getuid, sys_getuid)
503#define __NR_geteuid 175
504__SYSCALL(__NR_geteuid, sys_geteuid)
505#define __NR_getgid 176
506__SYSCALL(__NR_getgid, sys_getgid)
507#define __NR_getegid 177
508__SYSCALL(__NR_getegid, sys_getegid)
509#define __NR_gettid 178
510__SYSCALL(__NR_gettid, sys_gettid)
511#define __NR_sysinfo 179
512__SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo)
513
514/* ipc/mqueue.c */
515#define __NR_mq_open 180
516__SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open)
517#define __NR_mq_unlink 181
518__SYSCALL(__NR_mq_unlink, sys_mq_unlink)
519#define __NR_mq_timedsend 182
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100520__SC_3264(__NR_mq_timedsend, sys_mq_timedsend_time32, sys_mq_timedsend)
David Howells8a1ab312012-10-04 18:20:15 +0100521#define __NR_mq_timedreceive 183
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100522__SC_3264(__NR_mq_timedreceive, sys_mq_timedreceive_time32, \
523 sys_mq_timedreceive)
David Howells8a1ab312012-10-04 18:20:15 +0100524#define __NR_mq_notify 184
525__SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify)
526#define __NR_mq_getsetattr 185
527__SC_COMP(__NR_mq_getsetattr, sys_mq_getsetattr, compat_sys_mq_getsetattr)
528
529/* ipc/msg.c */
530#define __NR_msgget 186
531__SYSCALL(__NR_msgget, sys_msgget)
532#define __NR_msgctl 187
533__SC_COMP(__NR_msgctl, sys_msgctl, compat_sys_msgctl)
534#define __NR_msgrcv 188
535__SC_COMP(__NR_msgrcv, sys_msgrcv, compat_sys_msgrcv)
536#define __NR_msgsnd 189
537__SC_COMP(__NR_msgsnd, sys_msgsnd, compat_sys_msgsnd)
538
539/* ipc/sem.c */
540#define __NR_semget 190
541__SYSCALL(__NR_semget, sys_semget)
542#define __NR_semctl 191
543__SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl)
544#define __NR_semtimedop 192
Arnd Bergmann8dabe722019-01-07 00:33:08 +0100545__SC_COMP(__NR_semtimedop, sys_semtimedop, sys_semtimedop_time32)
David Howells8a1ab312012-10-04 18:20:15 +0100546#define __NR_semop 193
547__SYSCALL(__NR_semop, sys_semop)
548
549/* ipc/shm.c */
550#define __NR_shmget 194
551__SYSCALL(__NR_shmget, sys_shmget)
552#define __NR_shmctl 195
553__SC_COMP(__NR_shmctl, sys_shmctl, compat_sys_shmctl)
554#define __NR_shmat 196
555__SC_COMP(__NR_shmat, sys_shmat, compat_sys_shmat)
556#define __NR_shmdt 197
557__SYSCALL(__NR_shmdt, sys_shmdt)
558
559/* net/socket.c */
560#define __NR_socket 198
561__SYSCALL(__NR_socket, sys_socket)
562#define __NR_socketpair 199
563__SYSCALL(__NR_socketpair, sys_socketpair)
564#define __NR_bind 200
565__SYSCALL(__NR_bind, sys_bind)
566#define __NR_listen 201
567__SYSCALL(__NR_listen, sys_listen)
568#define __NR_accept 202
569__SYSCALL(__NR_accept, sys_accept)
570#define __NR_connect 203
571__SYSCALL(__NR_connect, sys_connect)
572#define __NR_getsockname 204
573__SYSCALL(__NR_getsockname, sys_getsockname)
574#define __NR_getpeername 205
575__SYSCALL(__NR_getpeername, sys_getpeername)
576#define __NR_sendto 206
577__SYSCALL(__NR_sendto, sys_sendto)
578#define __NR_recvfrom 207
579__SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom)
580#define __NR_setsockopt 208
581__SC_COMP(__NR_setsockopt, sys_setsockopt, compat_sys_setsockopt)
582#define __NR_getsockopt 209
583__SC_COMP(__NR_getsockopt, sys_getsockopt, compat_sys_getsockopt)
584#define __NR_shutdown 210
585__SYSCALL(__NR_shutdown, sys_shutdown)
586#define __NR_sendmsg 211
587__SC_COMP(__NR_sendmsg, sys_sendmsg, compat_sys_sendmsg)
588#define __NR_recvmsg 212
589__SC_COMP(__NR_recvmsg, sys_recvmsg, compat_sys_recvmsg)
590
591/* mm/filemap.c */
592#define __NR_readahead 213
593__SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead)
594
595/* mm/nommu.c, also with MMU */
596#define __NR_brk 214
597__SYSCALL(__NR_brk, sys_brk)
598#define __NR_munmap 215
599__SYSCALL(__NR_munmap, sys_munmap)
600#define __NR_mremap 216
601__SYSCALL(__NR_mremap, sys_mremap)
602
603/* security/keys/keyctl.c */
604#define __NR_add_key 217
605__SYSCALL(__NR_add_key, sys_add_key)
606#define __NR_request_key 218
607__SYSCALL(__NR_request_key, sys_request_key)
608#define __NR_keyctl 219
609__SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl)
610
611/* arch/example/kernel/sys_example.c */
612#define __NR_clone 220
613__SYSCALL(__NR_clone, sys_clone)
614#define __NR_execve 221
615__SC_COMP(__NR_execve, sys_execve, compat_sys_execve)
616
617#define __NR3264_mmap 222
618__SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap)
619/* mm/fadvise.c */
620#define __NR3264_fadvise64 223
621__SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64)
622
623/* mm/, CONFIG_MMU only */
624#ifndef __ARCH_NOMMU
625#define __NR_swapon 224
626__SYSCALL(__NR_swapon, sys_swapon)
627#define __NR_swapoff 225
628__SYSCALL(__NR_swapoff, sys_swapoff)
629#define __NR_mprotect 226
630__SYSCALL(__NR_mprotect, sys_mprotect)
631#define __NR_msync 227
632__SYSCALL(__NR_msync, sys_msync)
633#define __NR_mlock 228
634__SYSCALL(__NR_mlock, sys_mlock)
635#define __NR_munlock 229
636__SYSCALL(__NR_munlock, sys_munlock)
637#define __NR_mlockall 230
638__SYSCALL(__NR_mlockall, sys_mlockall)
639#define __NR_munlockall 231
640__SYSCALL(__NR_munlockall, sys_munlockall)
641#define __NR_mincore 232
642__SYSCALL(__NR_mincore, sys_mincore)
643#define __NR_madvise 233
644__SYSCALL(__NR_madvise, sys_madvise)
645#define __NR_remap_file_pages 234
646__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
647#define __NR_mbind 235
648__SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind)
649#define __NR_get_mempolicy 236
650__SC_COMP(__NR_get_mempolicy, sys_get_mempolicy, compat_sys_get_mempolicy)
651#define __NR_set_mempolicy 237
652__SC_COMP(__NR_set_mempolicy, sys_set_mempolicy, compat_sys_set_mempolicy)
653#define __NR_migrate_pages 238
654__SC_COMP(__NR_migrate_pages, sys_migrate_pages, compat_sys_migrate_pages)
655#define __NR_move_pages 239
656__SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages)
657#endif
658
659#define __NR_rt_tgsigqueueinfo 240
660__SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \
661 compat_sys_rt_tgsigqueueinfo)
662#define __NR_perf_event_open 241
663__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
664#define __NR_accept4 242
665__SYSCALL(__NR_accept4, sys_accept4)
666#define __NR_recvmmsg 243
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100667__SC_COMP_3264(__NR_recvmmsg, sys_recvmmsg_time32, sys_recvmmsg, compat_sys_recvmmsg_time32)
David Howells8a1ab312012-10-04 18:20:15 +0100668
669/*
670 * Architectures may provide up to 16 syscalls of their own
671 * starting with this value.
672 */
673#define __NR_arch_specific_syscall 244
674
675#define __NR_wait4 260
676__SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4)
677#define __NR_prlimit64 261
678__SYSCALL(__NR_prlimit64, sys_prlimit64)
679#define __NR_fanotify_init 262
680__SYSCALL(__NR_fanotify_init, sys_fanotify_init)
681#define __NR_fanotify_mark 263
682__SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
683#define __NR_name_to_handle_at 264
684__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
685#define __NR_open_by_handle_at 265
Yury Norov0d0216c2018-05-16 11:18:48 +0300686__SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at)
David Howells8a1ab312012-10-04 18:20:15 +0100687#define __NR_clock_adjtime 266
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100688__SC_3264(__NR_clock_adjtime, sys_clock_adjtime32, sys_clock_adjtime)
David Howells8a1ab312012-10-04 18:20:15 +0100689#define __NR_syncfs 267
690__SYSCALL(__NR_syncfs, sys_syncfs)
691#define __NR_setns 268
692__SYSCALL(__NR_setns, sys_setns)
693#define __NR_sendmmsg 269
694__SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg)
695#define __NR_process_vm_readv 270
696__SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \
697 compat_sys_process_vm_readv)
698#define __NR_process_vm_writev 271
699__SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \
700 compat_sys_process_vm_writev)
701#define __NR_kcmp 272
702__SYSCALL(__NR_kcmp, sys_kcmp)
Kees Cook1625cee2012-10-16 12:40:03 +1030703#define __NR_finit_module 273
704__SYSCALL(__NR_finit_module, sys_finit_module)
James Hogane6cfc022014-02-03 15:33:37 +0000705#define __NR_sched_setattr 274
706__SYSCALL(__NR_sched_setattr, sys_sched_setattr)
707#define __NR_sched_getattr 275
708__SYSCALL(__NR_sched_getattr, sys_sched_getattr)
James Hogan63ba6002014-04-23 11:08:05 +0100709#define __NR_renameat2 276
710__SYSCALL(__NR_renameat2, sys_renameat2)
Kees Cook48dc92b2014-06-25 16:08:24 -0700711#define __NR_seccomp 277
712__SYSCALL(__NR_seccomp, sys_seccomp)
Theodore Ts'oc6e9d6f2014-07-17 04:13:05 -0400713#define __NR_getrandom 278
714__SYSCALL(__NR_getrandom, sys_getrandom)
Will Deacon503e6632014-08-11 14:24:47 +0100715#define __NR_memfd_create 279
716__SYSCALL(__NR_memfd_create, sys_memfd_create)
Alexei Starovoitov749730c2014-09-26 00:16:58 -0700717#define __NR_bpf 280
718__SYSCALL(__NR_bpf, sys_bpf)
David Drysdale51f39a12014-12-12 16:57:29 -0800719#define __NR_execveat 281
720__SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat)
Dr. David Alan Gilbert09f72982015-09-22 14:59:09 -0700721#define __NR_userfaultfd 282
722__SYSCALL(__NR_userfaultfd, sys_userfaultfd)
723#define __NR_membarrier 283
Mathieu Desnoyers5b25b132015-09-11 13:07:39 -0700724__SYSCALL(__NR_membarrier, sys_membarrier)
Eric B Munsona8ca5d02015-11-05 18:51:33 -0800725#define __NR_mlock2 284
726__SYSCALL(__NR_mlock2, sys_mlock2)
Zach Brown29732932015-11-10 16:53:30 -0500727#define __NR_copy_file_range 285
728__SYSCALL(__NR_copy_file_range, sys_copy_file_range)
Andre Przywara987aedb2016-04-11 10:17:46 +0100729#define __NR_preadv2 286
Yury Norov1f93e9f2016-05-02 19:12:47 +0300730__SC_COMP(__NR_preadv2, sys_preadv2, compat_sys_preadv2)
Andre Przywara987aedb2016-04-11 10:17:46 +0100731#define __NR_pwritev2 287
Yury Norov1f93e9f2016-05-02 19:12:47 +0300732__SC_COMP(__NR_pwritev2, sys_pwritev2, compat_sys_pwritev2)
Dave Hansena60f7b62016-07-29 09:30:18 -0700733#define __NR_pkey_mprotect 288
734__SYSCALL(__NR_pkey_mprotect, sys_pkey_mprotect)
735#define __NR_pkey_alloc 289
736__SYSCALL(__NR_pkey_alloc, sys_pkey_alloc)
737#define __NR_pkey_free 290
738__SYSCALL(__NR_pkey_free, sys_pkey_free)
Stafford Hornefdfe4a32017-03-13 23:45:21 +0900739#define __NR_statx 291
740__SYSCALL(__NR_statx, sys_statx)
Christoph Hellwig7a074e92018-05-02 19:51:00 +0200741#define __NR_io_pgetevents 292
Arnd Bergmann00bf25d2019-01-01 01:13:32 +0100742__SC_COMP_3264(__NR_io_pgetevents, sys_io_pgetevents_time32, sys_io_pgetevents, compat_sys_io_pgetevents)
Will Deacondb7a2d12018-06-20 14:58:10 +0100743#define __NR_rseq 293
744__SYSCALL(__NR_rseq, sys_rseq)
AKASHI Takahiro4e215652018-11-15 14:52:40 +0900745#define __NR_kexec_file_load 294
746__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
Arnd Bergmann0d6040d2018-12-31 14:38:26 +0100747/* 295 through 402 are unassigned to sync up with generic numbers, don't use */
Arnd Bergmann48166e62019-01-10 12:45:11 +0100748#if __BITS_PER_LONG == 32
749#define __NR_clock_gettime64 403
750__SYSCALL(__NR_clock_gettime64, sys_clock_gettime)
751#define __NR_clock_settime64 404
752__SYSCALL(__NR_clock_settime64, sys_clock_settime)
753#define __NR_clock_adjtime64 405
754__SYSCALL(__NR_clock_adjtime64, sys_clock_adjtime)
755#define __NR_clock_getres_time64 406
756__SYSCALL(__NR_clock_getres_time64, sys_clock_getres)
757#define __NR_clock_nanosleep_time64 407
758__SYSCALL(__NR_clock_nanosleep_time64, sys_clock_nanosleep)
759#define __NR_timer_gettime64 408
760__SYSCALL(__NR_timer_gettime64, sys_timer_gettime)
761#define __NR_timer_settime64 409
762__SYSCALL(__NR_timer_settime64, sys_timer_settime)
763#define __NR_timerfd_gettime64 410
764__SYSCALL(__NR_timerfd_gettime64, sys_timerfd_gettime)
765#define __NR_timerfd_settime64 411
766__SYSCALL(__NR_timerfd_settime64, sys_timerfd_settime)
767#define __NR_utimensat_time64 412
768__SYSCALL(__NR_utimensat_time64, sys_utimensat)
769#define __NR_pselect6_time64 413
770__SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64)
771#define __NR_ppoll_time64 414
772__SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64)
773#define __NR_io_pgetevents_time64 416
774__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents)
775#define __NR_recvmmsg_time64 417
776__SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64)
777#define __NR_mq_timedsend_time64 418
778__SYSCALL(__NR_mq_timedsend_time64, sys_mq_timedsend)
779#define __NR_mq_timedreceive_time64 419
780__SYSCALL(__NR_mq_timedreceive_time64, sys_mq_timedreceive)
781#define __NR_semtimedop_time64 420
782__SYSCALL(__NR_semtimedop_time64, sys_semtimedop)
783#define __NR_rt_sigtimedwait_time64 421
784__SC_COMP(__NR_rt_sigtimedwait_time64, sys_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time64)
785#define __NR_futex_time64 422
786__SYSCALL(__NR_futex_time64, sys_futex)
787#define __NR_sched_rr_get_interval_time64 423
788__SYSCALL(__NR_sched_rr_get_interval_time64, sys_sched_rr_get_interval)
789#endif
David Howells8a1ab312012-10-04 18:20:15 +0100790
791#undef __NR_syscalls
Arnd Bergmann48166e62019-01-10 12:45:11 +0100792#define __NR_syscalls 424
David Howells8a1ab312012-10-04 18:20:15 +0100793
794/*
David Howells8a1ab312012-10-04 18:20:15 +0100795 * 32 bit systems traditionally used different
796 * syscalls for off_t and loff_t arguments, while
797 * 64 bit systems only need the off_t version.
798 * For new 32 bit platforms, there is no need to
799 * implement the old 32 bit off_t syscalls, so
800 * they take different names.
801 * Here we map the numbers so that both versions
802 * use the same syscall table layout.
803 */
804#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
805#define __NR_fcntl __NR3264_fcntl
806#define __NR_statfs __NR3264_statfs
807#define __NR_fstatfs __NR3264_fstatfs
808#define __NR_truncate __NR3264_truncate
809#define __NR_ftruncate __NR3264_ftruncate
810#define __NR_lseek __NR3264_lseek
811#define __NR_sendfile __NR3264_sendfile
Guo Renb7d624a2018-12-06 10:07:40 +0800812#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
David Howells8a1ab312012-10-04 18:20:15 +0100813#define __NR_newfstatat __NR3264_fstatat
814#define __NR_fstat __NR3264_fstat
Guo Renb7d624a2018-12-06 10:07:40 +0800815#endif
David Howells8a1ab312012-10-04 18:20:15 +0100816#define __NR_mmap __NR3264_mmap
817#define __NR_fadvise64 __NR3264_fadvise64
818#ifdef __NR3264_stat
819#define __NR_stat __NR3264_stat
820#define __NR_lstat __NR3264_lstat
821#endif
822#else
823#define __NR_fcntl64 __NR3264_fcntl
824#define __NR_statfs64 __NR3264_statfs
825#define __NR_fstatfs64 __NR3264_fstatfs
826#define __NR_truncate64 __NR3264_truncate
827#define __NR_ftruncate64 __NR3264_ftruncate
828#define __NR_llseek __NR3264_lseek
829#define __NR_sendfile64 __NR3264_sendfile
Guo Renb7d624a2018-12-06 10:07:40 +0800830#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
David Howells8a1ab312012-10-04 18:20:15 +0100831#define __NR_fstatat64 __NR3264_fstatat
832#define __NR_fstat64 __NR3264_fstat
Guo Renb7d624a2018-12-06 10:07:40 +0800833#endif
David Howells8a1ab312012-10-04 18:20:15 +0100834#define __NR_mmap2 __NR3264_mmap
835#define __NR_fadvise64_64 __NR3264_fadvise64
836#ifdef __NR3264_stat
837#define __NR_stat64 __NR3264_stat
838#define __NR_lstat64 __NR3264_lstat
839#endif
840#endif