blob: 635482e60ca39f93e706f51dbccf7a19dfefe284 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2#include <linux/linkage.h>
3#include <linux/errno.h>
4
5#include <asm/unistd.h>
6
Adrian Bunk0732a552007-10-16 23:29:25 -07007/* we can't #include <linux/syscalls.h> here,
8 but tell gcc to not warn with -Wmissing-prototypes */
9asmlinkage long sys_ni_syscall(void);
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011/*
12 * Non-implemented system calls get redirected here.
13 */
14asmlinkage long sys_ni_syscall(void)
15{
16 return -ENOSYS;
17}
18
Linus Torvalds1da177e2005-04-16 15:20:36 -070019cond_syscall(sys_quotactl);
Vasily Tarasovb7163952007-07-15 23:41:12 -070020cond_syscall(sys32_quotactl);
Linus Torvalds1da177e2005-04-16 15:20:36 -070021cond_syscall(sys_acct);
22cond_syscall(sys_lookup_dcookie);
Al Virod5dc77b2013-02-25 18:42:04 -050023cond_syscall(compat_sys_lookup_dcookie);
Linus Torvalds1da177e2005-04-16 15:20:36 -070024cond_syscall(sys_swapon);
25cond_syscall(sys_swapoff);
Eric W. Biedermandc009d92005-06-25 14:57:52 -070026cond_syscall(sys_kexec_load);
27cond_syscall(compat_sys_kexec_load);
Vivek Goyalf0895682014-08-08 14:25:55 -070028cond_syscall(sys_kexec_file_load);
Linus Torvalds1da177e2005-04-16 15:20:36 -070029cond_syscall(sys_init_module);
Kees Cook34e11692012-10-16 07:31:07 +103030cond_syscall(sys_finit_module);
Linus Torvalds1da177e2005-04-16 15:20:36 -070031cond_syscall(sys_delete_module);
32cond_syscall(sys_socketpair);
33cond_syscall(sys_bind);
34cond_syscall(sys_listen);
35cond_syscall(sys_accept);
Ulrich Drepperde11def2008-11-19 15:36:14 -080036cond_syscall(sys_accept4);
Linus Torvalds1da177e2005-04-16 15:20:36 -070037cond_syscall(sys_connect);
38cond_syscall(sys_getsockname);
39cond_syscall(sys_getpeername);
40cond_syscall(sys_sendto);
41cond_syscall(sys_send);
42cond_syscall(sys_recvfrom);
43cond_syscall(sys_recv);
44cond_syscall(sys_socket);
45cond_syscall(sys_setsockopt);
David S. Millerf3baa482007-10-29 00:54:39 -070046cond_syscall(compat_sys_setsockopt);
Linus Torvalds1da177e2005-04-16 15:20:36 -070047cond_syscall(sys_getsockopt);
David S. Millerf3baa482007-10-29 00:54:39 -070048cond_syscall(compat_sys_getsockopt);
Linus Torvalds1da177e2005-04-16 15:20:36 -070049cond_syscall(sys_shutdown);
50cond_syscall(sys_sendmsg);
Anton Blanchard228e5482011-05-02 20:21:35 +000051cond_syscall(sys_sendmmsg);
David S. Millerf3baa482007-10-29 00:54:39 -070052cond_syscall(compat_sys_sendmsg);
Anton Blanchard228e5482011-05-02 20:21:35 +000053cond_syscall(compat_sys_sendmmsg);
Linus Torvalds1da177e2005-04-16 15:20:36 -070054cond_syscall(sys_recvmsg);
Arnaldo Carvalho de Meloa2e27252009-10-12 23:40:10 -070055cond_syscall(sys_recvmmsg);
David S. Millerf3baa482007-10-29 00:54:39 -070056cond_syscall(compat_sys_recvmsg);
Stephen Rothwell1ef21192010-09-03 13:19:04 +100057cond_syscall(compat_sys_recv);
Andrew Mortondedcf292009-09-18 09:52:13 +000058cond_syscall(compat_sys_recvfrom);
Arnaldo Carvalho de Meloa2e27252009-10-12 23:40:10 -070059cond_syscall(compat_sys_recvmmsg);
Linus Torvalds1da177e2005-04-16 15:20:36 -070060cond_syscall(sys_socketcall);
61cond_syscall(sys_futex);
62cond_syscall(compat_sys_futex);
Ingo Molnar0771dfe2006-03-27 01:16:22 -080063cond_syscall(sys_set_robust_list);
64cond_syscall(compat_sys_set_robust_list);
65cond_syscall(sys_get_robust_list);
66cond_syscall(compat_sys_get_robust_list);
Linus Torvalds1da177e2005-04-16 15:20:36 -070067cond_syscall(sys_epoll_create);
Wang Chen5df439e2008-07-25 01:45:23 -070068cond_syscall(sys_epoll_create1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070069cond_syscall(sys_epoll_ctl);
70cond_syscall(sys_epoll_wait);
Randy Dunlap39af1142006-10-16 09:01:46 -070071cond_syscall(sys_epoll_pwait);
Atsushi Nemoto5f171562008-07-21 14:21:37 -070072cond_syscall(compat_sys_epoll_pwait);
Linus Torvalds1da177e2005-04-16 15:20:36 -070073cond_syscall(sys_semget);
74cond_syscall(sys_semop);
75cond_syscall(sys_semtimedop);
Kevin Cernekeebe84bfc2011-05-17 10:39:58 -070076cond_syscall(compat_sys_semtimedop);
Linus Torvalds1da177e2005-04-16 15:20:36 -070077cond_syscall(sys_semctl);
Kevin Cernekeebe84bfc2011-05-17 10:39:58 -070078cond_syscall(compat_sys_semctl);
Linus Torvalds1da177e2005-04-16 15:20:36 -070079cond_syscall(sys_msgget);
80cond_syscall(sys_msgsnd);
Kevin Cernekeebe84bfc2011-05-17 10:39:58 -070081cond_syscall(compat_sys_msgsnd);
Linus Torvalds1da177e2005-04-16 15:20:36 -070082cond_syscall(sys_msgrcv);
Kevin Cernekeebe84bfc2011-05-17 10:39:58 -070083cond_syscall(compat_sys_msgrcv);
Linus Torvalds1da177e2005-04-16 15:20:36 -070084cond_syscall(sys_msgctl);
Kevin Cernekeebe84bfc2011-05-17 10:39:58 -070085cond_syscall(compat_sys_msgctl);
Linus Torvalds1da177e2005-04-16 15:20:36 -070086cond_syscall(sys_shmget);
Stephen Rothwell7d87e142005-05-01 08:59:12 -070087cond_syscall(sys_shmat);
Kevin Cernekeebe84bfc2011-05-17 10:39:58 -070088cond_syscall(compat_sys_shmat);
Linus Torvalds1da177e2005-04-16 15:20:36 -070089cond_syscall(sys_shmdt);
90cond_syscall(sys_shmctl);
Kevin Cernekeebe84bfc2011-05-17 10:39:58 -070091cond_syscall(compat_sys_shmctl);
Linus Torvalds1da177e2005-04-16 15:20:36 -070092cond_syscall(sys_mq_open);
93cond_syscall(sys_mq_unlink);
94cond_syscall(sys_mq_timedsend);
95cond_syscall(sys_mq_timedreceive);
96cond_syscall(sys_mq_notify);
97cond_syscall(sys_mq_getsetattr);
98cond_syscall(compat_sys_mq_open);
99cond_syscall(compat_sys_mq_timedsend);
100cond_syscall(compat_sys_mq_timedreceive);
101cond_syscall(compat_sys_mq_notify);
102cond_syscall(compat_sys_mq_getsetattr);
103cond_syscall(sys_mbind);
104cond_syscall(sys_get_mempolicy);
105cond_syscall(sys_set_mempolicy);
106cond_syscall(compat_sys_mbind);
107cond_syscall(compat_sys_get_mempolicy);
108cond_syscall(compat_sys_set_mempolicy);
109cond_syscall(sys_add_key);
110cond_syscall(sys_request_key);
111cond_syscall(sys_keyctl);
112cond_syscall(compat_sys_keyctl);
113cond_syscall(compat_sys_socketcall);
Robert Love0eeca282005-07-12 17:06:03 -0400114cond_syscall(sys_inotify_init);
Ulrich Drepper40065532008-07-23 21:29:32 -0700115cond_syscall(sys_inotify_init1);
Robert Love0eeca282005-07-12 17:06:03 -0400116cond_syscall(sys_inotify_add_watch);
117cond_syscall(sys_inotify_rm_watch);
Christoph Lameter39743882006-01-08 01:00:51 -0800118cond_syscall(sys_migrate_pages);
Christoph Lameter742755a2006-06-23 02:03:55 -0700119cond_syscall(sys_move_pages);
Matt Mackalle585e472006-01-08 01:05:24 -0800120cond_syscall(sys_chown16);
121cond_syscall(sys_fchown16);
122cond_syscall(sys_getegid16);
123cond_syscall(sys_geteuid16);
124cond_syscall(sys_getgid16);
125cond_syscall(sys_getgroups16);
126cond_syscall(sys_getresgid16);
127cond_syscall(sys_getresuid16);
128cond_syscall(sys_getuid16);
129cond_syscall(sys_lchown16);
130cond_syscall(sys_setfsgid16);
131cond_syscall(sys_setfsuid16);
132cond_syscall(sys_setgid16);
133cond_syscall(sys_setgroups16);
134cond_syscall(sys_setregid16);
135cond_syscall(sys_setresgid16);
136cond_syscall(sys_setresuid16);
137cond_syscall(sys_setreuid16);
138cond_syscall(sys_setuid16);
Fabian Frederickf6187762014-06-04 16:11:12 -0700139cond_syscall(sys_sgetmask);
140cond_syscall(sys_ssetmask);
Matt Mackall64ca9002006-01-08 01:05:26 -0800141cond_syscall(sys_vm86old);
142cond_syscall(sys_vm86);
Andy Lutomirskia5b9e5a2015-07-30 14:31:34 -0700143cond_syscall(sys_modify_ldt);
Christoph Hellwigbaed7fc2010-03-10 15:21:18 -0800144cond_syscall(sys_ipc);
Stephen Rothwell7fd105e2006-02-20 18:28:08 -0800145cond_syscall(compat_sys_ipc);
146cond_syscall(compat_sys_sysctl);
Thomas Petazzonibfcd17a2008-08-06 15:12:22 +0200147cond_syscall(sys_flock);
Thomas Petazzoniebf3f092008-10-15 22:05:12 -0700148cond_syscall(sys_io_setup);
149cond_syscall(sys_io_destroy);
150cond_syscall(sys_io_submit);
151cond_syscall(sys_io_cancel);
152cond_syscall(sys_io_getevents);
Fabian Frederick6af9f7b2014-04-03 14:48:25 -0700153cond_syscall(sys_sysfs);
Heiko Carstensf627a742009-01-14 14:13:58 +0100154cond_syscall(sys_syslog);
Christopher Yeohfcf63402011-10-31 17:06:39 -0700155cond_syscall(sys_process_vm_readv);
156cond_syscall(sys_process_vm_writev);
157cond_syscall(compat_sys_process_vm_readv);
158cond_syscall(compat_sys_process_vm_writev);
Josh Triplett69369a72014-04-03 14:48:27 -0700159cond_syscall(sys_uselib);
Josh Triplettd3ac21c2014-08-17 19:41:09 -0500160cond_syscall(sys_fadvise64);
161cond_syscall(sys_fadvise64_64);
162cond_syscall(sys_madvise);
Iulia Manda28138932015-04-15 16:16:41 -0700163cond_syscall(sys_setuid);
164cond_syscall(sys_setregid);
165cond_syscall(sys_setgid);
166cond_syscall(sys_setreuid);
167cond_syscall(sys_setresuid);
168cond_syscall(sys_getresuid);
169cond_syscall(sys_setresgid);
170cond_syscall(sys_getresgid);
171cond_syscall(sys_setgroups);
172cond_syscall(sys_getgroups);
173cond_syscall(sys_setfsuid);
174cond_syscall(sys_setfsgid);
175cond_syscall(sys_capget);
176cond_syscall(sys_capset);
Zach Brown29732932015-11-10 16:53:30 -0500177cond_syscall(sys_copy_file_range);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178
179/* arch-specific weak syscall entries */
180cond_syscall(sys_pciconfig_read);
181cond_syscall(sys_pciconfig_write);
182cond_syscall(sys_pciconfig_iobase);
Al Viro56e41d32013-01-21 23:15:25 -0500183cond_syscall(compat_sys_s390_ipc);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184cond_syscall(ppc_rtas);
Arnd Bergmann67207b92005-11-15 15:53:48 -0500185cond_syscall(sys_spu_run);
186cond_syscall(sys_spu_create);
Paul Mackerrasfa282372008-01-24 08:35:13 +1100187cond_syscall(sys_subpage_prot);
Alexey Ishchuk4eafad72014-11-14 14:27:58 +0100188cond_syscall(sys_s390_pci_mmio_read);
189cond_syscall(sys_s390_pci_mmio_write);
Hyok S. Choi3016b422006-04-10 22:53:06 -0700190
191/* mmu depending weak syscall entries */
192cond_syscall(sys_mprotect);
193cond_syscall(sys_msync);
194cond_syscall(sys_mlock);
195cond_syscall(sys_munlock);
196cond_syscall(sys_mlockall);
197cond_syscall(sys_munlockall);
Eric B Munsona8ca5d02015-11-05 18:51:33 -0800198cond_syscall(sys_mlock2);
Hyok S. Choi3016b422006-04-10 22:53:06 -0700199cond_syscall(sys_mincore);
200cond_syscall(sys_madvise);
201cond_syscall(sys_mremap);
202cond_syscall(sys_remap_file_pages);
Christoph Lameter1b2db9f2006-06-23 02:03:56 -0700203cond_syscall(compat_sys_move_pages);
Stephen Rothwell3fd59392006-11-02 22:07:24 -0800204cond_syscall(compat_sys_migrate_pages);
David Howells93614012006-09-30 20:45:40 +0200205
206/* block-layer dependent */
207cond_syscall(sys_bdflush);
208cond_syscall(sys_ioprio_set);
209cond_syscall(sys_ioprio_get);
Davide Libenzifba2afa2007-05-10 22:23:13 -0700210
211/* New file descriptors */
212cond_syscall(sys_signalfd);
Ulrich Drepper9deb27b2008-07-23 21:29:24 -0700213cond_syscall(sys_signalfd4);
Heiko Carstens8df767d2007-05-12 10:37:02 -0700214cond_syscall(compat_sys_signalfd);
Ingo Molnar9b813612008-07-25 13:02:37 +0200215cond_syscall(compat_sys_signalfd4);
Davide Libenzi4d672e72008-02-04 22:27:26 -0800216cond_syscall(sys_timerfd_create);
217cond_syscall(sys_timerfd_settime);
218cond_syscall(sys_timerfd_gettime);
219cond_syscall(compat_sys_timerfd_settime);
220cond_syscall(compat_sys_timerfd_gettime);
Davide Libenzie1ad7462007-05-10 22:23:19 -0700221cond_syscall(sys_eventfd);
Ulrich Drepperb087498e2008-07-23 21:29:25 -0700222cond_syscall(sys_eventfd2);
David Herrmann9183df22014-08-08 14:25:29 -0700223cond_syscall(sys_memfd_create);
Andrea Arcangeli1380fca2015-09-04 15:46:58 -0700224cond_syscall(sys_userfaultfd);
Thomas Gleixner0793a612008-12-04 20:12:29 +0100225
226/* performance counters: */
Ingo Molnarcdd6c482009-09-21 12:02:48 +0200227cond_syscall(sys_perf_event_open);
Eric Paris11637e42009-12-17 21:24:25 -0500228
229/* fanotify! */
230cond_syscall(sys_fanotify_init);
Eric Parisbbaa4162009-12-17 21:24:26 -0500231cond_syscall(sys_fanotify_mark);
Al Viro91c2e0b2013-03-05 20:10:59 -0500232cond_syscall(compat_sys_fanotify_mark);
Aneesh Kumar K.V990d6c22011-01-29 18:43:26 +0530233
234/* open by handle */
235cond_syscall(sys_name_to_handle_at);
Aneesh Kumar K.Vbecfd1f2011-01-29 18:43:26 +0530236cond_syscall(sys_open_by_handle_at);
237cond_syscall(compat_sys_open_by_handle_at);
Cyrill Gorcunovd97b46a2012-05-31 16:26:44 -0700238
239/* compare kernel pointers */
240cond_syscall(sys_kcmp);
Kees Cook48dc92b2014-06-25 16:08:24 -0700241
242/* operate on Secure Computing state */
243cond_syscall(sys_seccomp);
Alexei Starovoitov749730c2014-09-26 00:16:58 -0700244
245/* access BPF programs and maps */
246cond_syscall(sys_bpf);
David Drysdale51f39a12014-12-12 16:57:29 -0800247
248/* execveat */
249cond_syscall(sys_execveat);
Mathieu Desnoyers5b25b132015-09-11 13:07:39 -0700250
251/* membarrier */
252cond_syscall(sys_membarrier);
Dave Hansene2753292016-09-12 13:38:42 -0700253
254/* memory protection keys */
255cond_syscall(sys_pkey_mprotect);
256cond_syscall(sys_pkey_alloc);
257cond_syscall(sys_pkey_free);