1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 #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 42 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 43 #define __NR_io_getevents 4 44 __SC_3264(__NR_io_getevents, sys_io_getevents_time32, sys_io_getevents) 45 #endif 46 47 #define __NR_setxattr 5 48 __SYSCALL(__NR_setxattr, sys_setxattr) 49 #define __NR_lsetxattr 6 50 __SYSCALL(__NR_lsetxattr, sys_lsetxattr) 51 #define __NR_fsetxattr 7 52 __SYSCALL(__NR_fsetxattr, sys_fsetxattr) 53 #define __NR_getxattr 8 54 __SYSCALL(__NR_getxattr, sys_getxattr) 55 #define __NR_lgetxattr 9 56 __SYSCALL(__NR_lgetxattr, sys_lgetxattr) 57 #define __NR_fgetxattr 10 58 __SYSCALL(__NR_fgetxattr, sys_fgetxattr) 59 #define __NR_listxattr 11 60 __SYSCALL(__NR_listxattr, sys_listxattr) 61 #define __NR_llistxattr 12 62 __SYSCALL(__NR_llistxattr, sys_llistxattr) 63 #define __NR_flistxattr 13 64 __SYSCALL(__NR_flistxattr, sys_flistxattr) 65 #define __NR_removexattr 14 66 __SYSCALL(__NR_removexattr, sys_removexattr) 67 #define __NR_lremovexattr 15 68 __SYSCALL(__NR_lremovexattr, sys_lremovexattr) 69 #define __NR_fremovexattr 16 70 __SYSCALL(__NR_fremovexattr, sys_fremovexattr) 71 #define __NR_getcwd 17 72 __SYSCALL(__NR_getcwd, sys_getcwd) 73 #define __NR_lookup_dcookie 18 74 __SYSCALL(__NR_lookup_dcookie, sys_ni_syscall) 75 #define __NR_eventfd2 19 76 __SYSCALL(__NR_eventfd2, sys_eventfd2) 77 #define __NR_epoll_create1 20 78 __SYSCALL(__NR_epoll_create1, sys_epoll_create1) 79 #define __NR_epoll_ctl 21 80 __SYSCALL(__NR_epoll_ctl, sys_epoll_ctl) 81 #define __NR_epoll_pwait 22 82 __SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait) 83 #define __NR_dup 23 84 __SYSCALL(__NR_dup, sys_dup) 85 #define __NR_dup3 24 86 __SYSCALL(__NR_dup3, sys_dup3) 87 #define __NR3264_fcntl 25 88 __SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64) 89 #define __NR_inotify_init1 26 90 __SYSCALL(__NR_inotify_init1, sys_inotify_init1) 91 #define __NR_inotify_add_watch 27 92 __SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch) 93 #define __NR_inotify_rm_watch 28 94 __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch) 95 #define __NR_ioctl 29 96 __SC_COMP(__NR_ioctl, sys_ioctl, compat_sys_ioctl) 97 #define __NR_ioprio_set 30 98 __SYSCALL(__NR_ioprio_set, sys_ioprio_set) 99 #define __NR_ioprio_get 31 100 __SYSCALL(__NR_ioprio_get, sys_ioprio_get) 101 #define __NR_flock 32 102 __SYSCALL(__NR_flock, sys_flock) 103 #define __NR_mknodat 33 104 __SYSCALL(__NR_mknodat, sys_mknodat) 105 #define __NR_mkdirat 34 106 __SYSCALL(__NR_mkdirat, sys_mkdirat) 107 #define __NR_unlinkat 35 108 __SYSCALL(__NR_unlinkat, sys_unlinkat) 109 #define __NR_symlinkat 36 110 __SYSCALL(__NR_symlinkat, sys_symlinkat) 111 #define __NR_linkat 37 112 __SYSCALL(__NR_linkat, sys_linkat) 113 114 #ifdef __ARCH_WANT_RENAMEAT 115 /* renameat is superseded with flags by renameat2 */ 116 #define __NR_renameat 38 117 __SYSCALL(__NR_renameat, sys_renameat) 118 #endif /* __ARCH_WANT_RENAMEAT */ 119 120 #define __NR_umount2 39 121 __SYSCALL(__NR_umount2, sys_umount) 122 #define __NR_mount 40 123 __SYSCALL(__NR_mount, sys_mount) 124 #define __NR_pivot_root 41 125 __SYSCALL(__NR_pivot_root, sys_pivot_root) 126 #define __NR_nfsservctl 42 127 __SYSCALL(__NR_nfsservctl, sys_ni_syscall) 128 #define __NR3264_statfs 43 129 __SC_COMP_3264(__NR3264_statfs, sys_statfs64, sys_statfs, \ 130 compat_sys_statfs64) 131 #define __NR3264_fstatfs 44 132 __SC_COMP_3264(__NR3264_fstatfs, sys_fstatfs64, sys_fstatfs, \ 133 compat_sys_fstatfs64) 134 #define __NR3264_truncate 45 135 __SC_COMP_3264(__NR3264_truncate, sys_truncate64, sys_truncate, \ 136 compat_sys_truncate64) 137 #define __NR3264_ftruncate 46 138 __SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \ 139 compat_sys_ftruncate64) 140 #define __NR_fallocate 47 141 __SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate) 142 #define __NR_faccessat 48 143 __SYSCALL(__NR_faccessat, sys_faccessat) 144 #define __NR_chdir 49 145 __SYSCALL(__NR_chdir, sys_chdir) 146 #define __NR_fchdir 50 147 __SYSCALL(__NR_fchdir, sys_fchdir) 148 #define __NR_chroot 51 149 __SYSCALL(__NR_chroot, sys_chroot) 150 #define __NR_fchmod 52 151 __SYSCALL(__NR_fchmod, sys_fchmod) 152 #define __NR_fchmodat 53 153 __SYSCALL(__NR_fchmodat, sys_fchmodat) 154 #define __NR_fchownat 54 155 __SYSCALL(__NR_fchownat, sys_fchownat) 156 #define __NR_fchown 55 157 __SYSCALL(__NR_fchown, sys_fchown) 158 #define __NR_openat 56 159 __SYSCALL(__NR_openat, sys_openat) 160 #define __NR_close 57 161 __SYSCALL(__NR_close, sys_close) 162 #define __NR_vhangup 58 163 __SYSCALL(__NR_vhangup, sys_vhangup) 164 #define __NR_pipe2 59 165 __SYSCALL(__NR_pipe2, sys_pipe2) 166 #define __NR_quotactl 60 167 __SYSCALL(__NR_quotactl, sys_quotactl) 168 #define __NR_getdents64 61 169 __SYSCALL(__NR_getdents64, sys_getdents64) 170 #define __NR3264_lseek 62 171 __SC_3264(__NR3264_lseek, sys_llseek, sys_lseek) 172 #define __NR_read 63 173 __SYSCALL(__NR_read, sys_read) 174 #define __NR_write 64 175 __SYSCALL(__NR_write, sys_write) 176 #define __NR_readv 65 177 __SC_COMP(__NR_readv, sys_readv, sys_readv) 178 #define __NR_writev 66 179 __SC_COMP(__NR_writev, sys_writev, sys_writev) 180 #define __NR_pread64 67 181 __SC_COMP(__NR_pread64, sys_pread64, compat_sys_pread64) 182 #define __NR_pwrite64 68 183 __SC_COMP(__NR_pwrite64, sys_pwrite64, compat_sys_pwrite64) 184 #define __NR_preadv 69 185 __SC_COMP(__NR_preadv, sys_preadv, compat_sys_preadv) 186 #define __NR_pwritev 70 187 __SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev) 188 #define __NR3264_sendfile 71 189 __SYSCALL(__NR3264_sendfile, sys_sendfile64) 190 191 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 192 #define __NR_pselect6 72 193 __SC_COMP_3264(__NR_pselect6, sys_pselect6_time32, sys_pselect6, compat_sys_pselect6_time32) 194 #define __NR_ppoll 73 195 __SC_COMP_3264(__NR_ppoll, sys_ppoll_time32, sys_ppoll, compat_sys_ppoll_time32) 196 #endif 197 198 #define __NR_signalfd4 74 199 __SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4) 200 #define __NR_vmsplice 75 201 __SYSCALL(__NR_vmsplice, sys_vmsplice) 202 #define __NR_splice 76 203 __SYSCALL(__NR_splice, sys_splice) 204 #define __NR_tee 77 205 __SYSCALL(__NR_tee, sys_tee) 206 #define __NR_readlinkat 78 207 __SYSCALL(__NR_readlinkat, sys_readlinkat) 208 209 #if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64) 210 #define __NR3264_fstatat 79 211 __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat) 212 #define __NR3264_fstat 80 213 __SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat) 214 #endif 215 216 #define __NR_sync 81 217 __SYSCALL(__NR_sync, sys_sync) 218 #define __NR_fsync 82 219 __SYSCALL(__NR_fsync, sys_fsync) 220 #define __NR_fdatasync 83 221 __SYSCALL(__NR_fdatasync, sys_fdatasync) 222 223 #ifdef __ARCH_WANT_SYNC_FILE_RANGE2 224 #define __NR_sync_file_range2 84 225 __SC_COMP(__NR_sync_file_range2, sys_sync_file_range2, \ 226 compat_sys_sync_file_range2) 227 #else 228 #define __NR_sync_file_range 84 229 __SC_COMP(__NR_sync_file_range, sys_sync_file_range, \ 230 compat_sys_sync_file_range) 231 #endif 232 233 #define __NR_timerfd_create 85 234 __SYSCALL(__NR_timerfd_create, sys_timerfd_create) 235 236 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 237 #define __NR_timerfd_settime 86 238 __SC_3264(__NR_timerfd_settime, sys_timerfd_settime32, \ 239 sys_timerfd_settime) 240 #define __NR_timerfd_gettime 87 241 __SC_3264(__NR_timerfd_gettime, sys_timerfd_gettime32, \ 242 sys_timerfd_gettime) 243 #endif 244 245 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 246 #define __NR_utimensat 88 247 __SC_3264(__NR_utimensat, sys_utimensat_time32, sys_utimensat) 248 #endif 249 250 #define __NR_acct 89 251 __SYSCALL(__NR_acct, sys_acct) 252 #define __NR_capget 90 253 __SYSCALL(__NR_capget, sys_capget) 254 #define __NR_capset 91 255 __SYSCALL(__NR_capset, sys_capset) 256 #define __NR_personality 92 257 __SYSCALL(__NR_personality, sys_personality) 258 #define __NR_exit 93 259 __SYSCALL(__NR_exit, sys_exit) 260 #define __NR_exit_group 94 261 __SYSCALL(__NR_exit_group, sys_exit_group) 262 #define __NR_waitid 95 263 __SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid) 264 #define __NR_set_tid_address 96 265 __SYSCALL(__NR_set_tid_address, sys_set_tid_address) 266 #define __NR_unshare 97 267 __SYSCALL(__NR_unshare, sys_unshare) 268 269 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 270 #define __NR_futex 98 271 __SC_3264(__NR_futex, sys_futex_time32, sys_futex) 272 #endif 273 274 #define __NR_set_robust_list 99 275 __SC_COMP(__NR_set_robust_list, sys_set_robust_list, \ 276 compat_sys_set_robust_list) 277 #define __NR_get_robust_list 100 278 __SC_COMP(__NR_get_robust_list, sys_get_robust_list, \ 279 compat_sys_get_robust_list) 280 281 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 282 #define __NR_nanosleep 101 283 __SC_3264(__NR_nanosleep, sys_nanosleep_time32, sys_nanosleep) 284 #endif 285 286 #define __NR_getitimer 102 287 __SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer) 288 #define __NR_setitimer 103 289 __SC_COMP(__NR_setitimer, sys_setitimer, compat_sys_setitimer) 290 #define __NR_kexec_load 104 291 __SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load) 292 #define __NR_init_module 105 293 __SYSCALL(__NR_init_module, sys_init_module) 294 #define __NR_delete_module 106 295 __SYSCALL(__NR_delete_module, sys_delete_module) 296 #define __NR_timer_create 107 297 __SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create) 298 299 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 300 #define __NR_timer_gettime 108 301 __SC_3264(__NR_timer_gettime, sys_timer_gettime32, sys_timer_gettime) 302 #endif 303 304 #define __NR_timer_getoverrun 109 305 __SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun) 306 307 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 308 #define __NR_timer_settime 110 309 __SC_3264(__NR_timer_settime, sys_timer_settime32, sys_timer_settime) 310 #endif 311 312 #define __NR_timer_delete 111 313 __SYSCALL(__NR_timer_delete, sys_timer_delete) 314 315 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 316 #define __NR_clock_settime 112 317 __SC_3264(__NR_clock_settime, sys_clock_settime32, sys_clock_settime) 318 #define __NR_clock_gettime 113 319 __SC_3264(__NR_clock_gettime, sys_clock_gettime32, sys_clock_gettime) 320 #define __NR_clock_getres 114 321 __SC_3264(__NR_clock_getres, sys_clock_getres_time32, sys_clock_getres) 322 #define __NR_clock_nanosleep 115 323 __SC_3264(__NR_clock_nanosleep, sys_clock_nanosleep_time32, \ 324 sys_clock_nanosleep) 325 #endif 326 327 #define __NR_syslog 116 328 __SYSCALL(__NR_syslog, sys_syslog) 329 #define __NR_ptrace 117 330 __SC_COMP(__NR_ptrace, sys_ptrace, compat_sys_ptrace) 331 #define __NR_sched_setparam 118 332 __SYSCALL(__NR_sched_setparam, sys_sched_setparam) 333 #define __NR_sched_setscheduler 119 334 __SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler) 335 #define __NR_sched_getscheduler 120 336 __SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler) 337 #define __NR_sched_getparam 121 338 __SYSCALL(__NR_sched_getparam, sys_sched_getparam) 339 #define __NR_sched_setaffinity 122 340 __SC_COMP(__NR_sched_setaffinity, sys_sched_setaffinity, \ 341 compat_sys_sched_setaffinity) 342 #define __NR_sched_getaffinity 123 343 __SC_COMP(__NR_sched_getaffinity, sys_sched_getaffinity, \ 344 compat_sys_sched_getaffinity) 345 #define __NR_sched_yield 124 346 __SYSCALL(__NR_sched_yield, sys_sched_yield) 347 #define __NR_sched_get_priority_max 125 348 __SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max) 349 #define __NR_sched_get_priority_min 126 350 __SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min) 351 352 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 353 #define __NR_sched_rr_get_interval 127 354 __SC_3264(__NR_sched_rr_get_interval, sys_sched_rr_get_interval_time32, \ 355 sys_sched_rr_get_interval) 356 #endif 357 358 #define __NR_restart_syscall 128 359 __SYSCALL(__NR_restart_syscall, sys_restart_syscall) 360 #define __NR_kill 129 361 __SYSCALL(__NR_kill, sys_kill) 362 #define __NR_tkill 130 363 __SYSCALL(__NR_tkill, sys_tkill) 364 #define __NR_tgkill 131 365 __SYSCALL(__NR_tgkill, sys_tgkill) 366 #define __NR_sigaltstack 132 367 __SC_COMP(__NR_sigaltstack, sys_sigaltstack, compat_sys_sigaltstack) 368 #define __NR_rt_sigsuspend 133 369 __SC_COMP(__NR_rt_sigsuspend, sys_rt_sigsuspend, compat_sys_rt_sigsuspend) 370 #define __NR_rt_sigaction 134 371 __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction) 372 #define __NR_rt_sigprocmask 135 373 __SC_COMP(__NR_rt_sigprocmask, sys_rt_sigprocmask, compat_sys_rt_sigprocmask) 374 #define __NR_rt_sigpending 136 375 __SC_COMP(__NR_rt_sigpending, sys_rt_sigpending, compat_sys_rt_sigpending) 376 377 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 378 #define __NR_rt_sigtimedwait 137 379 __SC_COMP_3264(__NR_rt_sigtimedwait, sys_rt_sigtimedwait_time32, \ 380 sys_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time32) 381 #endif 382 383 #define __NR_rt_sigqueueinfo 138 384 __SC_COMP(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo, \ 385 compat_sys_rt_sigqueueinfo) 386 #define __NR_rt_sigreturn 139 387 __SC_COMP(__NR_rt_sigreturn, sys_rt_sigreturn, compat_sys_rt_sigreturn) 388 #define __NR_setpriority 140 389 __SYSCALL(__NR_setpriority, sys_setpriority) 390 #define __NR_getpriority 141 391 __SYSCALL(__NR_getpriority, sys_getpriority) 392 #define __NR_reboot 142 393 __SYSCALL(__NR_reboot, sys_reboot) 394 #define __NR_setregid 143 395 __SYSCALL(__NR_setregid, sys_setregid) 396 #define __NR_setgid 144 397 __SYSCALL(__NR_setgid, sys_setgid) 398 #define __NR_setreuid 145 399 __SYSCALL(__NR_setreuid, sys_setreuid) 400 #define __NR_setuid 146 401 __SYSCALL(__NR_setuid, sys_setuid) 402 #define __NR_setresuid 147 403 __SYSCALL(__NR_setresuid, sys_setresuid) 404 #define __NR_getresuid 148 405 __SYSCALL(__NR_getresuid, sys_getresuid) 406 #define __NR_setresgid 149 407 __SYSCALL(__NR_setresgid, sys_setresgid) 408 #define __NR_getresgid 150 409 __SYSCALL(__NR_getresgid, sys_getresgid) 410 #define __NR_setfsuid 151 411 __SYSCALL(__NR_setfsuid, sys_setfsuid) 412 #define __NR_setfsgid 152 413 __SYSCALL(__NR_setfsgid, sys_setfsgid) 414 #define __NR_times 153 415 __SC_COMP(__NR_times, sys_times, compat_sys_times) 416 #define __NR_setpgid 154 417 __SYSCALL(__NR_setpgid, sys_setpgid) 418 #define __NR_getpgid 155 419 __SYSCALL(__NR_getpgid, sys_getpgid) 420 #define __NR_getsid 156 421 __SYSCALL(__NR_getsid, sys_getsid) 422 #define __NR_setsid 157 423 __SYSCALL(__NR_setsid, sys_setsid) 424 #define __NR_getgroups 158 425 __SYSCALL(__NR_getgroups, sys_getgroups) 426 #define __NR_setgroups 159 427 __SYSCALL(__NR_setgroups, sys_setgroups) 428 #define __NR_uname 160 429 __SYSCALL(__NR_uname, sys_newuname) 430 #define __NR_sethostname 161 431 __SYSCALL(__NR_sethostname, sys_sethostname) 432 #define __NR_setdomainname 162 433 __SYSCALL(__NR_setdomainname, sys_setdomainname) 434 435 #ifdef __ARCH_WANT_SET_GET_RLIMIT 436 /* getrlimit and setrlimit are superseded with prlimit64 */ 437 #define __NR_getrlimit 163 438 __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit) 439 #define __NR_setrlimit 164 440 __SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit) 441 #endif 442 443 #define __NR_getrusage 165 444 __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage) 445 #define __NR_umask 166 446 __SYSCALL(__NR_umask, sys_umask) 447 #define __NR_prctl 167 448 __SYSCALL(__NR_prctl, sys_prctl) 449 #define __NR_getcpu 168 450 __SYSCALL(__NR_getcpu, sys_getcpu) 451 452 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 453 #define __NR_gettimeofday 169 454 __SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday) 455 #define __NR_settimeofday 170 456 __SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday) 457 #define __NR_adjtimex 171 458 __SC_3264(__NR_adjtimex, sys_adjtimex_time32, sys_adjtimex) 459 #endif 460 461 #define __NR_getpid 172 462 __SYSCALL(__NR_getpid, sys_getpid) 463 #define __NR_getppid 173 464 __SYSCALL(__NR_getppid, sys_getppid) 465 #define __NR_getuid 174 466 __SYSCALL(__NR_getuid, sys_getuid) 467 #define __NR_geteuid 175 468 __SYSCALL(__NR_geteuid, sys_geteuid) 469 #define __NR_getgid 176 470 __SYSCALL(__NR_getgid, sys_getgid) 471 #define __NR_getegid 177 472 __SYSCALL(__NR_getegid, sys_getegid) 473 #define __NR_gettid 178 474 __SYSCALL(__NR_gettid, sys_gettid) 475 #define __NR_sysinfo 179 476 __SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo) 477 #define __NR_mq_open 180 478 __SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open) 479 #define __NR_mq_unlink 181 480 __SYSCALL(__NR_mq_unlink, sys_mq_unlink) 481 482 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 483 #define __NR_mq_timedsend 182 484 __SC_3264(__NR_mq_timedsend, sys_mq_timedsend_time32, sys_mq_timedsend) 485 #define __NR_mq_timedreceive 183 486 __SC_3264(__NR_mq_timedreceive, sys_mq_timedreceive_time32, \ 487 sys_mq_timedreceive) 488 #endif 489 490 #define __NR_mq_notify 184 491 __SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify) 492 #define __NR_mq_getsetattr 185 493 __SC_COMP(__NR_mq_getsetattr, sys_mq_getsetattr, compat_sys_mq_getsetattr) 494 #define __NR_msgget 186 495 __SYSCALL(__NR_msgget, sys_msgget) 496 #define __NR_msgctl 187 497 __SC_COMP(__NR_msgctl, sys_msgctl, compat_sys_msgctl) 498 #define __NR_msgrcv 188 499 __SC_COMP(__NR_msgrcv, sys_msgrcv, compat_sys_msgrcv) 500 #define __NR_msgsnd 189 501 __SC_COMP(__NR_msgsnd, sys_msgsnd, compat_sys_msgsnd) 502 #define __NR_semget 190 503 __SYSCALL(__NR_semget, sys_semget) 504 #define __NR_semctl 191 505 __SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl) 506 507 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 508 #define __NR_semtimedop 192 509 __SC_3264(__NR_semtimedop, sys_semtimedop_time32, sys_semtimedop) 510 #endif 511 512 #define __NR_semop 193 513 __SYSCALL(__NR_semop, sys_semop) 514 #define __NR_shmget 194 515 __SYSCALL(__NR_shmget, sys_shmget) 516 #define __NR_shmctl 195 517 __SC_COMP(__NR_shmctl, sys_shmctl, compat_sys_shmctl) 518 #define __NR_shmat 196 519 __SC_COMP(__NR_shmat, sys_shmat, compat_sys_shmat) 520 #define __NR_shmdt 197 521 __SYSCALL(__NR_shmdt, sys_shmdt) 522 #define __NR_socket 198 523 __SYSCALL(__NR_socket, sys_socket) 524 #define __NR_socketpair 199 525 __SYSCALL(__NR_socketpair, sys_socketpair) 526 #define __NR_bind 200 527 __SYSCALL(__NR_bind, sys_bind) 528 #define __NR_listen 201 529 __SYSCALL(__NR_listen, sys_listen) 530 #define __NR_accept 202 531 __SYSCALL(__NR_accept, sys_accept) 532 #define __NR_connect 203 533 __SYSCALL(__NR_connect, sys_connect) 534 #define __NR_getsockname 204 535 __SYSCALL(__NR_getsockname, sys_getsockname) 536 #define __NR_getpeername 205 537 __SYSCALL(__NR_getpeername, sys_getpeername) 538 #define __NR_sendto 206 539 __SYSCALL(__NR_sendto, sys_sendto) 540 #define __NR_recvfrom 207 541 __SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom) 542 #define __NR_setsockopt 208 543 __SC_COMP(__NR_setsockopt, sys_setsockopt, sys_setsockopt) 544 #define __NR_getsockopt 209 545 __SC_COMP(__NR_getsockopt, sys_getsockopt, sys_getsockopt) 546 #define __NR_shutdown 210 547 __SYSCALL(__NR_shutdown, sys_shutdown) 548 #define __NR_sendmsg 211 549 __SC_COMP(__NR_sendmsg, sys_sendmsg, compat_sys_sendmsg) 550 #define __NR_recvmsg 212 551 __SC_COMP(__NR_recvmsg, sys_recvmsg, compat_sys_recvmsg) 552 #define __NR_readahead 213 553 __SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead) 554 #define __NR_brk 214 555 __SYSCALL(__NR_brk, sys_brk) 556 #define __NR_munmap 215 557 __SYSCALL(__NR_munmap, sys_munmap) 558 #define __NR_mremap 216 559 __SYSCALL(__NR_mremap, sys_mremap) 560 #define __NR_add_key 217 561 __SYSCALL(__NR_add_key, sys_add_key) 562 #define __NR_request_key 218 563 __SYSCALL(__NR_request_key, sys_request_key) 564 #define __NR_keyctl 219 565 __SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl) 566 #define __NR_clone 220 567 __SYSCALL(__NR_clone, sys_clone) 568 #define __NR_execve 221 569 __SC_COMP(__NR_execve, sys_execve, compat_sys_execve) 570 #define __NR3264_mmap 222 571 __SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap) 572 #define __NR3264_fadvise64 223 573 __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64) 574 575 /* CONFIG_MMU only */ 576 #ifndef __ARCH_NOMMU 577 #define __NR_swapon 224 578 __SYSCALL(__NR_swapon, sys_swapon) 579 #define __NR_swapoff 225 580 __SYSCALL(__NR_swapoff, sys_swapoff) 581 #define __NR_mprotect 226 582 __SYSCALL(__NR_mprotect, sys_mprotect) 583 #define __NR_msync 227 584 __SYSCALL(__NR_msync, sys_msync) 585 #define __NR_mlock 228 586 __SYSCALL(__NR_mlock, sys_mlock) 587 #define __NR_munlock 229 588 __SYSCALL(__NR_munlock, sys_munlock) 589 #define __NR_mlockall 230 590 __SYSCALL(__NR_mlockall, sys_mlockall) 591 #define __NR_munlockall 231 592 __SYSCALL(__NR_munlockall, sys_munlockall) 593 #define __NR_mincore 232 594 __SYSCALL(__NR_mincore, sys_mincore) 595 #define __NR_madvise 233 596 __SYSCALL(__NR_madvise, sys_madvise) 597 #define __NR_remap_file_pages 234 598 __SYSCALL(__NR_remap_file_pages, sys_remap_file_pages) 599 #define __NR_mbind 235 600 __SYSCALL(__NR_mbind, sys_mbind) 601 #define __NR_get_mempolicy 236 602 __SYSCALL(__NR_get_mempolicy, sys_get_mempolicy) 603 #define __NR_set_mempolicy 237 604 __SYSCALL(__NR_set_mempolicy, sys_set_mempolicy) 605 #define __NR_migrate_pages 238 606 __SYSCALL(__NR_migrate_pages, sys_migrate_pages) 607 #define __NR_move_pages 239 608 __SYSCALL(__NR_move_pages, sys_move_pages) 609 #endif 610 611 #define __NR_rt_tgsigqueueinfo 240 612 __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \ 613 compat_sys_rt_tgsigqueueinfo) 614 #define __NR_perf_event_open 241 615 __SYSCALL(__NR_perf_event_open, sys_perf_event_open) 616 #define __NR_accept4 242 617 __SYSCALL(__NR_accept4, sys_accept4) 618 619 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 620 #define __NR_recvmmsg 243 621 __SC_COMP_3264(__NR_recvmmsg, sys_recvmmsg_time32, sys_recvmmsg, compat_sys_recvmmsg_time32) 622 #endif 623 624 /* 625 * Architectures may provide up to 16 syscalls of their own 626 * starting with this value. 627 */ 628 #define __NR_arch_specific_syscall 244 629 630 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 631 #define __NR_wait4 260 632 __SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4) 633 #endif 634 635 #define __NR_prlimit64 261 636 __SYSCALL(__NR_prlimit64, sys_prlimit64) 637 #define __NR_fanotify_init 262 638 __SYSCALL(__NR_fanotify_init, sys_fanotify_init) 639 #define __NR_fanotify_mark 263 640 __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark) 641 #define __NR_name_to_handle_at 264 642 __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) 643 #define __NR_open_by_handle_at 265 644 __SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) 645 646 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 647 #define __NR_clock_adjtime 266 648 __SC_3264(__NR_clock_adjtime, sys_clock_adjtime32, sys_clock_adjtime) 649 #endif 650 651 #define __NR_syncfs 267 652 __SYSCALL(__NR_syncfs, sys_syncfs) 653 #define __NR_setns 268 654 __SYSCALL(__NR_setns, sys_setns) 655 #define __NR_sendmmsg 269 656 __SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg) 657 #define __NR_process_vm_readv 270 658 __SYSCALL(__NR_process_vm_readv, sys_process_vm_readv) 659 #define __NR_process_vm_writev 271 660 __SYSCALL(__NR_process_vm_writev, sys_process_vm_writev) 661 #define __NR_kcmp 272 662 __SYSCALL(__NR_kcmp, sys_kcmp) 663 #define __NR_finit_module 273 664 __SYSCALL(__NR_finit_module, sys_finit_module) 665 #define __NR_sched_setattr 274 666 __SYSCALL(__NR_sched_setattr, sys_sched_setattr) 667 #define __NR_sched_getattr 275 668 __SYSCALL(__NR_sched_getattr, sys_sched_getattr) 669 #define __NR_renameat2 276 670 __SYSCALL(__NR_renameat2, sys_renameat2) 671 #define __NR_seccomp 277 672 __SYSCALL(__NR_seccomp, sys_seccomp) 673 #define __NR_getrandom 278 674 __SYSCALL(__NR_getrandom, sys_getrandom) 675 #define __NR_memfd_create 279 676 __SYSCALL(__NR_memfd_create, sys_memfd_create) 677 #define __NR_bpf 280 678 __SYSCALL(__NR_bpf, sys_bpf) 679 #define __NR_execveat 281 680 __SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat) 681 #define __NR_userfaultfd 282 682 __SYSCALL(__NR_userfaultfd, sys_userfaultfd) 683 #define __NR_membarrier 283 684 __SYSCALL(__NR_membarrier, sys_membarrier) 685 #define __NR_mlock2 284 686 __SYSCALL(__NR_mlock2, sys_mlock2) 687 #define __NR_copy_file_range 285 688 __SYSCALL(__NR_copy_file_range, sys_copy_file_range) 689 #define __NR_preadv2 286 690 __SC_COMP(__NR_preadv2, sys_preadv2, compat_sys_preadv2) 691 #define __NR_pwritev2 287 692 __SC_COMP(__NR_pwritev2, sys_pwritev2, compat_sys_pwritev2) 693 #define __NR_pkey_mprotect 288 694 __SYSCALL(__NR_pkey_mprotect, sys_pkey_mprotect) 695 #define __NR_pkey_alloc 289 696 __SYSCALL(__NR_pkey_alloc, sys_pkey_alloc) 697 #define __NR_pkey_free 290 698 __SYSCALL(__NR_pkey_free, sys_pkey_free) 699 #define __NR_statx 291 700 __SYSCALL(__NR_statx, sys_statx) 701 702 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 703 #define __NR_io_pgetevents 292 704 __SC_COMP_3264(__NR_io_pgetevents, sys_io_pgetevents_time32, sys_io_pgetevents, compat_sys_io_pgetevents) 705 #endif 706 707 #define __NR_rseq 293 708 __SYSCALL(__NR_rseq, sys_rseq) 709 #define __NR_kexec_file_load 294 710 __SYSCALL(__NR_kexec_file_load, sys_kexec_file_load) 711 712 /* 295 through 402 are unassigned to sync up with generic numbers, don't use */ 713 714 #if defined(__SYSCALL_COMPAT) || __BITS_PER_LONG == 32 715 #define __NR_clock_gettime64 403 716 __SYSCALL(__NR_clock_gettime64, sys_clock_gettime) 717 #define __NR_clock_settime64 404 718 __SYSCALL(__NR_clock_settime64, sys_clock_settime) 719 #define __NR_clock_adjtime64 405 720 __SYSCALL(__NR_clock_adjtime64, sys_clock_adjtime) 721 #define __NR_clock_getres_time64 406 722 __SYSCALL(__NR_clock_getres_time64, sys_clock_getres) 723 #define __NR_clock_nanosleep_time64 407 724 __SYSCALL(__NR_clock_nanosleep_time64, sys_clock_nanosleep) 725 #define __NR_timer_gettime64 408 726 __SYSCALL(__NR_timer_gettime64, sys_timer_gettime) 727 #define __NR_timer_settime64 409 728 __SYSCALL(__NR_timer_settime64, sys_timer_settime) 729 #define __NR_timerfd_gettime64 410 730 __SYSCALL(__NR_timerfd_gettime64, sys_timerfd_gettime) 731 #define __NR_timerfd_settime64 411 732 __SYSCALL(__NR_timerfd_settime64, sys_timerfd_settime) 733 #define __NR_utimensat_time64 412 734 __SYSCALL(__NR_utimensat_time64, sys_utimensat) 735 #define __NR_pselect6_time64 413 736 __SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64) 737 #define __NR_ppoll_time64 414 738 __SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64) 739 #define __NR_io_pgetevents_time64 416 740 __SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents) 741 #define __NR_recvmmsg_time64 417 742 __SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64) 743 #define __NR_mq_timedsend_time64 418 744 __SYSCALL(__NR_mq_timedsend_time64, sys_mq_timedsend) 745 #define __NR_mq_timedreceive_time64 419 746 __SYSCALL(__NR_mq_timedreceive_time64, sys_mq_timedreceive) 747 #define __NR_semtimedop_time64 420 748 __SYSCALL(__NR_semtimedop_time64, sys_semtimedop) 749 #define __NR_rt_sigtimedwait_time64 421 750 __SC_COMP(__NR_rt_sigtimedwait_time64, sys_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time64) 751 #define __NR_futex_time64 422 752 __SYSCALL(__NR_futex_time64, sys_futex) 753 #define __NR_sched_rr_get_interval_time64 423 754 __SYSCALL(__NR_sched_rr_get_interval_time64, sys_sched_rr_get_interval) 755 #endif 756 757 #define __NR_pidfd_send_signal 424 758 __SYSCALL(__NR_pidfd_send_signal, sys_pidfd_send_signal) 759 #define __NR_io_uring_setup 425 760 __SYSCALL(__NR_io_uring_setup, sys_io_uring_setup) 761 #define __NR_io_uring_enter 426 762 __SYSCALL(__NR_io_uring_enter, sys_io_uring_enter) 763 #define __NR_io_uring_register 427 764 __SYSCALL(__NR_io_uring_register, sys_io_uring_register) 765 #define __NR_open_tree 428 766 __SYSCALL(__NR_open_tree, sys_open_tree) 767 #define __NR_move_mount 429 768 __SYSCALL(__NR_move_mount, sys_move_mount) 769 #define __NR_fsopen 430 770 __SYSCALL(__NR_fsopen, sys_fsopen) 771 #define __NR_fsconfig 431 772 __SYSCALL(__NR_fsconfig, sys_fsconfig) 773 #define __NR_fsmount 432 774 __SYSCALL(__NR_fsmount, sys_fsmount) 775 #define __NR_fspick 433 776 __SYSCALL(__NR_fspick, sys_fspick) 777 #define __NR_pidfd_open 434 778 __SYSCALL(__NR_pidfd_open, sys_pidfd_open) 779 780 #ifdef __ARCH_WANT_SYS_CLONE3 781 #define __NR_clone3 435 782 __SYSCALL(__NR_clone3, sys_clone3) 783 #endif 784 785 #define __NR_close_range 436 786 __SYSCALL(__NR_close_range, sys_close_range) 787 #define __NR_openat2 437 788 __SYSCALL(__NR_openat2, sys_openat2) 789 #define __NR_pidfd_getfd 438 790 __SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd) 791 #define __NR_faccessat2 439 792 __SYSCALL(__NR_faccessat2, sys_faccessat2) 793 #define __NR_process_madvise 440 794 __SYSCALL(__NR_process_madvise, sys_process_madvise) 795 #define __NR_epoll_pwait2 441 796 __SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2) 797 #define __NR_mount_setattr 442 798 __SYSCALL(__NR_mount_setattr, sys_mount_setattr) 799 #define __NR_quotactl_fd 443 800 __SYSCALL(__NR_quotactl_fd, sys_quotactl_fd) 801 #define __NR_landlock_create_ruleset 444 802 __SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset) 803 #define __NR_landlock_add_rule 445 804 __SYSCALL(__NR_landlock_add_rule, sys_landlock_add_rule) 805 #define __NR_landlock_restrict_self 446 806 __SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self) 807 808 #ifdef __ARCH_WANT_MEMFD_SECRET 809 #define __NR_memfd_secret 447 810 __SYSCALL(__NR_memfd_secret, sys_memfd_secret) 811 #endif 812 813 #define __NR_process_mrelease 448 814 __SYSCALL(__NR_process_mrelease, sys_process_mrelease) 815 #define __NR_futex_waitv 449 816 __SYSCALL(__NR_futex_waitv, sys_futex_waitv) 817 #define __NR_set_mempolicy_home_node 450 818 __SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node) 819 #define __NR_cachestat 451 820 __SYSCALL(__NR_cachestat, sys_cachestat) 821 #define __NR_fchmodat2 452 822 __SYSCALL(__NR_fchmodat2, sys_fchmodat2) 823 #define __NR_map_shadow_stack 453 824 __SYSCALL(__NR_map_shadow_stack, sys_map_shadow_stack) 825 #define __NR_futex_wake 454 826 __SYSCALL(__NR_futex_wake, sys_futex_wake) 827 #define __NR_futex_wait 455 828 __SYSCALL(__NR_futex_wait, sys_futex_wait) 829 #define __NR_futex_requeue 456 830 __SYSCALL(__NR_futex_requeue, sys_futex_requeue) 831 832 #define __NR_statmount 457 833 __SYSCALL(__NR_statmount, sys_statmount) 834 835 #define __NR_listmount 458 836 __SYSCALL(__NR_listmount, sys_listmount) 837 838 #define __NR_lsm_get_self_attr 459 839 __SYSCALL(__NR_lsm_get_self_attr, sys_lsm_get_self_attr) 840 #define __NR_lsm_set_self_attr 460 841 __SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr) 842 #define __NR_lsm_list_modules 461 843 __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) 844 845 #undef __NR_syscalls 846 #define __NR_syscalls 462 847 848 /* 849 * 32 bit systems traditionally used different 850 * syscalls for off_t and loff_t arguments, while 851 * 64 bit systems only need the off_t version. 852 * For new 32 bit platforms, there is no need to 853 * implement the old 32 bit off_t syscalls, so 854 * they take different names. 855 * Here we map the numbers so that both versions 856 * use the same syscall table layout. 857 */ 858 #if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT) 859 #define __NR_fcntl __NR3264_fcntl 860 #define __NR_statfs __NR3264_statfs 861 #define __NR_fstatfs __NR3264_fstatfs 862 #define __NR_truncate __NR3264_truncate 863 #define __NR_ftruncate __NR3264_ftruncate 864 #define __NR_lseek __NR3264_lseek 865 #define __NR_sendfile __NR3264_sendfile 866 #if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64) 867 #define __NR_newfstatat __NR3264_fstatat 868 #define __NR_fstat __NR3264_fstat 869 #endif 870 #define __NR_mmap __NR3264_mmap 871 #define __NR_fadvise64 __NR3264_fadvise64 872 #ifdef __NR3264_stat 873 #define __NR_stat __NR3264_stat 874 #define __NR_lstat __NR3264_lstat 875 #endif 876 #else 877 #define __NR_fcntl64 __NR3264_fcntl 878 #define __NR_statfs64 __NR3264_statfs 879 #define __NR_fstatfs64 __NR3264_fstatfs 880 #define __NR_truncate64 __NR3264_truncate 881 #define __NR_ftruncate64 __NR3264_ftruncate 882 #define __NR_llseek __NR3264_lseek 883 #define __NR_sendfile64 __NR3264_sendfile 884 #if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64) 885 #define __NR_fstatat64 __NR3264_fstatat 886 #define __NR_fstat64 __NR3264_fstat 887 #endif 888 #define __NR_mmap2 __NR3264_mmap 889 #define __NR_fadvise64_64 __NR3264_fadvise64 890 #ifdef __NR3264_stat 891 #define __NR_stat64 __NR3264_stat 892 #define __NR_lstat64 __NR3264_lstat 893 #endif 894 #endif 895