1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/linkage.h>
4 #include <linux/errno.h>
6 #include <asm/unistd.h>
8 #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
9 /* Architectures may override COND_SYSCALL and COND_SYSCALL_COMPAT */
10 #include <asm/syscall_wrapper.h>
11 #endif /* CONFIG_ARCH_HAS_SYSCALL_WRAPPER */
13 /* we can't #include <linux/syscalls.h> here,
14 but tell gcc to not warn with -Wmissing-prototypes */
15 asmlinkage long sys_ni_syscall(void);
18 * Non-implemented system calls get redirected here.
20 asmlinkage long sys_ni_syscall(void)
26 #define COND_SYSCALL(name) cond_syscall(sys_##name)
27 #endif /* COND_SYSCALL */
29 #ifndef COND_SYSCALL_COMPAT
30 #define COND_SYSCALL_COMPAT(name) cond_syscall(compat_sys_##name)
31 #endif /* COND_SYSCALL_COMPAT */
34 * This list is kept in the same order as include/uapi/asm-generic/unistd.h.
35 * Architecture specific entries go below, followed by deprecated or obsolete
39 COND_SYSCALL(io_setup);
40 COND_SYSCALL_COMPAT(io_setup);
41 COND_SYSCALL(io_destroy);
42 COND_SYSCALL(io_submit);
43 COND_SYSCALL_COMPAT(io_submit);
44 COND_SYSCALL(io_cancel);
45 COND_SYSCALL(io_getevents_time32);
46 COND_SYSCALL(io_getevents);
47 COND_SYSCALL(io_pgetevents_time32);
48 COND_SYSCALL(io_pgetevents);
49 COND_SYSCALL_COMPAT(io_pgetevents_time32);
50 COND_SYSCALL_COMPAT(io_pgetevents);
51 COND_SYSCALL(io_uring_setup);
52 COND_SYSCALL(io_uring_enter);
53 COND_SYSCALL(io_uring_register);
60 COND_SYSCALL(lookup_dcookie);
61 COND_SYSCALL_COMPAT(lookup_dcookie);
64 COND_SYSCALL(eventfd2);
67 COND_SYSCALL(epoll_create1);
68 COND_SYSCALL(epoll_ctl);
69 COND_SYSCALL(epoll_pwait);
70 COND_SYSCALL_COMPAT(epoll_pwait);
71 COND_SYSCALL(epoll_pwait2);
72 COND_SYSCALL_COMPAT(epoll_pwait2);
76 /* fs/inotify_user.c */
77 COND_SYSCALL(inotify_init1);
78 COND_SYSCALL(inotify_add_watch);
79 COND_SYSCALL(inotify_rm_watch);
84 COND_SYSCALL(ioprio_set);
85 COND_SYSCALL(ioprio_get);
101 COND_SYSCALL(quotactl);
105 /* fs/read_write.c */
112 COND_SYSCALL(signalfd4);
113 COND_SYSCALL_COMPAT(signalfd4);
122 COND_SYSCALL(timerfd_create);
123 COND_SYSCALL(timerfd_settime);
124 COND_SYSCALL(timerfd_settime32);
125 COND_SYSCALL(timerfd_gettime);
126 COND_SYSCALL(timerfd_gettime32);
133 /* kernel/capability.c */
134 COND_SYSCALL(capget);
135 COND_SYSCALL(capset);
137 /* kernel/exec_domain.c */
142 /* __ARCH_WANT_SYS_CLONE3 */
143 COND_SYSCALL(clone3);
147 COND_SYSCALL(futex_time32);
148 COND_SYSCALL(set_robust_list);
149 COND_SYSCALL_COMPAT(set_robust_list);
150 COND_SYSCALL(get_robust_list);
151 COND_SYSCALL_COMPAT(get_robust_list);
153 /* kernel/hrtimer.c */
155 /* kernel/itimer.c */
158 COND_SYSCALL(kexec_load);
159 COND_SYSCALL_COMPAT(kexec_load);
161 /* kernel/module.c */
162 COND_SYSCALL(init_module);
163 COND_SYSCALL(delete_module);
165 /* kernel/posix-timers.c */
167 /* kernel/printk.c */
168 COND_SYSCALL(syslog);
170 /* kernel/ptrace.c */
172 /* kernel/sched/core.c */
175 COND_SYSCALL(setregid);
176 COND_SYSCALL(setgid);
177 COND_SYSCALL(setreuid);
178 COND_SYSCALL(setuid);
179 COND_SYSCALL(setresuid);
180 COND_SYSCALL(getresuid);
181 COND_SYSCALL(setresgid);
182 COND_SYSCALL(getresgid);
183 COND_SYSCALL(setfsuid);
184 COND_SYSCALL(setfsgid);
185 COND_SYSCALL(setgroups);
186 COND_SYSCALL(getgroups);
193 COND_SYSCALL(mq_open);
194 COND_SYSCALL_COMPAT(mq_open);
195 COND_SYSCALL(mq_unlink);
196 COND_SYSCALL(mq_timedsend);
197 COND_SYSCALL(mq_timedsend_time32);
198 COND_SYSCALL(mq_timedreceive);
199 COND_SYSCALL(mq_timedreceive_time32);
200 COND_SYSCALL(mq_notify);
201 COND_SYSCALL_COMPAT(mq_notify);
202 COND_SYSCALL(mq_getsetattr);
203 COND_SYSCALL_COMPAT(mq_getsetattr);
206 COND_SYSCALL(msgget);
207 COND_SYSCALL(old_msgctl);
208 COND_SYSCALL(msgctl);
209 COND_SYSCALL_COMPAT(msgctl);
210 COND_SYSCALL_COMPAT(old_msgctl);
211 COND_SYSCALL(msgrcv);
212 COND_SYSCALL_COMPAT(msgrcv);
213 COND_SYSCALL(msgsnd);
214 COND_SYSCALL_COMPAT(msgsnd);
217 COND_SYSCALL(semget);
218 COND_SYSCALL(old_semctl);
219 COND_SYSCALL(semctl);
220 COND_SYSCALL_COMPAT(semctl);
221 COND_SYSCALL_COMPAT(old_semctl);
222 COND_SYSCALL(semtimedop);
223 COND_SYSCALL(semtimedop_time32);
227 COND_SYSCALL(shmget);
228 COND_SYSCALL(old_shmctl);
229 COND_SYSCALL(shmctl);
230 COND_SYSCALL_COMPAT(shmctl);
231 COND_SYSCALL_COMPAT(old_shmctl);
233 COND_SYSCALL_COMPAT(shmat);
237 COND_SYSCALL(socket);
238 COND_SYSCALL(socketpair);
240 COND_SYSCALL(listen);
241 COND_SYSCALL(accept);
242 COND_SYSCALL(connect);
243 COND_SYSCALL(getsockname);
244 COND_SYSCALL(getpeername);
245 COND_SYSCALL(setsockopt);
246 COND_SYSCALL_COMPAT(setsockopt);
247 COND_SYSCALL(getsockopt);
248 COND_SYSCALL_COMPAT(getsockopt);
249 COND_SYSCALL(sendto);
250 COND_SYSCALL(shutdown);
251 COND_SYSCALL(recvfrom);
252 COND_SYSCALL_COMPAT(recvfrom);
253 COND_SYSCALL(sendmsg);
254 COND_SYSCALL_COMPAT(sendmsg);
255 COND_SYSCALL(recvmsg);
256 COND_SYSCALL_COMPAT(recvmsg);
260 /* mm/nommu.c, also with MMU */
261 COND_SYSCALL(mremap);
263 /* security/keys/keyctl.c */
264 COND_SYSCALL(add_key);
265 COND_SYSCALL(request_key);
266 COND_SYSCALL(keyctl);
267 COND_SYSCALL_COMPAT(keyctl);
269 /* arch/example/kernel/sys_example.c */
272 COND_SYSCALL(fadvise64_64);
274 /* mm/, CONFIG_MMU only */
275 COND_SYSCALL(swapon);
276 COND_SYSCALL(swapoff);
277 COND_SYSCALL(mprotect);
280 COND_SYSCALL(munlock);
281 COND_SYSCALL(mlockall);
282 COND_SYSCALL(munlockall);
283 COND_SYSCALL(mincore);
284 COND_SYSCALL(madvise);
285 COND_SYSCALL(process_madvise);
286 COND_SYSCALL(remap_file_pages);
288 COND_SYSCALL_COMPAT(mbind);
289 COND_SYSCALL(get_mempolicy);
290 COND_SYSCALL_COMPAT(get_mempolicy);
291 COND_SYSCALL(set_mempolicy);
292 COND_SYSCALL_COMPAT(set_mempolicy);
293 COND_SYSCALL(migrate_pages);
294 COND_SYSCALL_COMPAT(migrate_pages);
295 COND_SYSCALL(move_pages);
296 COND_SYSCALL_COMPAT(move_pages);
298 COND_SYSCALL(perf_event_open);
299 COND_SYSCALL(accept4);
300 COND_SYSCALL(recvmmsg);
301 COND_SYSCALL(recvmmsg_time32);
302 COND_SYSCALL_COMPAT(recvmmsg_time32);
303 COND_SYSCALL_COMPAT(recvmmsg_time64);
306 * Architecture specific syscalls: see further below
310 COND_SYSCALL(fanotify_init);
311 COND_SYSCALL(fanotify_mark);
314 COND_SYSCALL(name_to_handle_at);
315 COND_SYSCALL(open_by_handle_at);
316 COND_SYSCALL_COMPAT(open_by_handle_at);
318 COND_SYSCALL(sendmmsg);
319 COND_SYSCALL_COMPAT(sendmmsg);
320 COND_SYSCALL(process_vm_readv);
321 COND_SYSCALL_COMPAT(process_vm_readv);
322 COND_SYSCALL(process_vm_writev);
323 COND_SYSCALL_COMPAT(process_vm_writev);
325 /* compare kernel pointers */
328 COND_SYSCALL(finit_module);
330 /* operate on Secure Computing state */
331 COND_SYSCALL(seccomp);
333 COND_SYSCALL(memfd_create);
335 /* access BPF programs and maps */
339 COND_SYSCALL(execveat);
341 COND_SYSCALL(userfaultfd);
344 COND_SYSCALL(membarrier);
346 COND_SYSCALL(mlock2);
348 COND_SYSCALL(copy_file_range);
350 /* memory protection keys */
351 COND_SYSCALL(pkey_mprotect);
352 COND_SYSCALL(pkey_alloc);
353 COND_SYSCALL(pkey_free);
357 * Architecture specific weak syscall entries.
360 /* pciconfig: alpha, arm, arm64, ia64, sparc */
361 COND_SYSCALL(pciconfig_read);
362 COND_SYSCALL(pciconfig_write);
363 COND_SYSCALL(pciconfig_iobase);
365 /* sys_socketcall: arm, mips, x86, ... */
366 COND_SYSCALL(socketcall);
367 COND_SYSCALL_COMPAT(socketcall);
369 /* compat syscalls for arm64, x86, ... */
370 COND_SYSCALL_COMPAT(fanotify_mark);
373 COND_SYSCALL(vm86old);
374 COND_SYSCALL(modify_ldt);
376 COND_SYSCALL(kexec_file_load);
379 COND_SYSCALL(s390_pci_mmio_read);
380 COND_SYSCALL(s390_pci_mmio_write);
381 COND_SYSCALL(s390_ipc);
382 COND_SYSCALL_COMPAT(s390_ipc);
386 COND_SYSCALL(spu_run);
387 COND_SYSCALL(spu_create);
388 COND_SYSCALL(subpage_prot);
392 * Deprecated system calls which are still defined in
393 * include/uapi/asm-generic/unistd.h and wanted by >= 1 arch
396 /* __ARCH_WANT_SYSCALL_NO_FLAGS */
397 COND_SYSCALL(epoll_create);
398 COND_SYSCALL(inotify_init);
399 COND_SYSCALL(eventfd);
400 COND_SYSCALL(signalfd);
401 COND_SYSCALL_COMPAT(signalfd);
403 /* __ARCH_WANT_SYSCALL_OFF_T */
404 COND_SYSCALL(fadvise64);
406 /* __ARCH_WANT_SYSCALL_DEPRECATED */
407 COND_SYSCALL(epoll_wait);
409 COND_SYSCALL_COMPAT(recv);
411 COND_SYSCALL(bdflush);
412 COND_SYSCALL(uselib);
414 /* optional: time32 */
415 COND_SYSCALL(time32);
416 COND_SYSCALL(stime32);
417 COND_SYSCALL(utime32);
418 COND_SYSCALL(adjtimex_time32);
419 COND_SYSCALL(sched_rr_get_interval_time32);
420 COND_SYSCALL(nanosleep_time32);
421 COND_SYSCALL(rt_sigtimedwait_time32);
422 COND_SYSCALL_COMPAT(rt_sigtimedwait_time32);
423 COND_SYSCALL(timer_settime32);
424 COND_SYSCALL(timer_gettime32);
425 COND_SYSCALL(clock_settime32);
426 COND_SYSCALL(clock_gettime32);
427 COND_SYSCALL(clock_getres_time32);
428 COND_SYSCALL(clock_nanosleep_time32);
429 COND_SYSCALL(utimes_time32);
430 COND_SYSCALL(futimesat_time32);
431 COND_SYSCALL(pselect6_time32);
432 COND_SYSCALL_COMPAT(pselect6_time32);
433 COND_SYSCALL(ppoll_time32);
434 COND_SYSCALL_COMPAT(ppoll_time32);
435 COND_SYSCALL(utimensat_time32);
436 COND_SYSCALL(clock_adjtime32);
439 * The syscalls below are not found in include/uapi/asm-generic/unistd.h
442 /* obsolete: SGETMASK_SYSCALL */
443 COND_SYSCALL(sgetmask);
444 COND_SYSCALL(ssetmask);
446 /* obsolete: SYSFS_SYSCALL */
449 /* obsolete: __ARCH_WANT_SYS_IPC */
451 COND_SYSCALL_COMPAT(ipc);
453 /* obsolete: UID16 */
454 COND_SYSCALL(chown16);
455 COND_SYSCALL(fchown16);
456 COND_SYSCALL(getegid16);
457 COND_SYSCALL(geteuid16);
458 COND_SYSCALL(getgid16);
459 COND_SYSCALL(getgroups16);
460 COND_SYSCALL(getresgid16);
461 COND_SYSCALL(getresuid16);
462 COND_SYSCALL(getuid16);
463 COND_SYSCALL(lchown16);
464 COND_SYSCALL(setfsgid16);
465 COND_SYSCALL(setfsuid16);
466 COND_SYSCALL(setgid16);
467 COND_SYSCALL(setgroups16);
468 COND_SYSCALL(setregid16);
469 COND_SYSCALL(setresgid16);
470 COND_SYSCALL(setresuid16);
471 COND_SYSCALL(setreuid16);
472 COND_SYSCALL(setuid16);
474 /* restartable sequence */