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
);
46 COND_SYSCALL_COMPAT(io_getevents
);
53 COND_SYSCALL(lookup_dcookie
);
54 COND_SYSCALL_COMPAT(lookup_dcookie
);
57 COND_SYSCALL(eventfd2
);
60 COND_SYSCALL(epoll_create1
);
61 COND_SYSCALL(epoll_ctl
);
62 COND_SYSCALL(epoll_pwait
);
63 COND_SYSCALL_COMPAT(epoll_pwait
);
67 /* fs/inotify_user.c */
68 COND_SYSCALL(inotify_init1
);
69 COND_SYSCALL(inotify_add_watch
);
70 COND_SYSCALL(inotify_rm_watch
);
75 COND_SYSCALL(ioprio_set
);
76 COND_SYSCALL(ioprio_get
);
92 COND_SYSCALL(quotactl
);
103 COND_SYSCALL(signalfd4
);
104 COND_SYSCALL_COMPAT(signalfd4
);
113 COND_SYSCALL(timerfd_create
);
114 COND_SYSCALL(timerfd_settime
);
115 COND_SYSCALL_COMPAT(timerfd_settime
);
116 COND_SYSCALL(timerfd_gettime
);
117 COND_SYSCALL_COMPAT(timerfd_gettime
);
124 /* kernel/capability.c */
125 COND_SYSCALL(capget
);
126 COND_SYSCALL(capset
);
128 /* kernel/exec_domain.c */
136 COND_SYSCALL_COMPAT(futex
);
137 COND_SYSCALL(set_robust_list
);
138 COND_SYSCALL_COMPAT(set_robust_list
);
139 COND_SYSCALL(get_robust_list
);
140 COND_SYSCALL_COMPAT(get_robust_list
);
142 /* kernel/hrtimer.c */
144 /* kernel/itimer.c */
147 COND_SYSCALL(kexec_load
);
148 COND_SYSCALL_COMPAT(kexec_load
);
150 /* kernel/module.c */
151 COND_SYSCALL(init_module
);
152 COND_SYSCALL(delete_module
);
154 /* kernel/posix-timers.c */
156 /* kernel/printk.c */
157 COND_SYSCALL(syslog
);
159 /* kernel/ptrace.c */
161 /* kernel/sched/core.c */
163 /* kernel/signal.c */
166 COND_SYSCALL(setregid
);
167 COND_SYSCALL(setgid
);
168 COND_SYSCALL(setreuid
);
169 COND_SYSCALL(setuid
);
170 COND_SYSCALL(setresuid
);
171 COND_SYSCALL(getresuid
);
172 COND_SYSCALL(setresgid
);
173 COND_SYSCALL(getresgid
);
174 COND_SYSCALL(setfsuid
);
175 COND_SYSCALL(setfsgid
);
176 COND_SYSCALL(setgroups
);
177 COND_SYSCALL(getgroups
);
184 COND_SYSCALL(mq_open
);
185 COND_SYSCALL_COMPAT(mq_open
);
186 COND_SYSCALL(mq_unlink
);
187 COND_SYSCALL(mq_timedsend
);
188 COND_SYSCALL_COMPAT(mq_timedsend
);
189 COND_SYSCALL(mq_timedreceive
);
190 COND_SYSCALL_COMPAT(mq_timedreceive
);
191 COND_SYSCALL(mq_notify
);
192 COND_SYSCALL_COMPAT(mq_notify
);
193 COND_SYSCALL(mq_getsetattr
);
194 COND_SYSCALL_COMPAT(mq_getsetattr
);
197 COND_SYSCALL(msgget
);
198 COND_SYSCALL(msgctl
);
199 COND_SYSCALL_COMPAT(msgctl
);
200 COND_SYSCALL(msgrcv
);
201 COND_SYSCALL_COMPAT(msgrcv
);
202 COND_SYSCALL(msgsnd
);
203 COND_SYSCALL_COMPAT(msgsnd
);
206 COND_SYSCALL(semget
);
207 COND_SYSCALL(semctl
);
208 COND_SYSCALL_COMPAT(semctl
);
209 COND_SYSCALL(semtimedop
);
210 COND_SYSCALL_COMPAT(semtimedop
);
214 COND_SYSCALL(shmget
);
215 COND_SYSCALL(shmctl
);
216 COND_SYSCALL_COMPAT(shmctl
);
218 COND_SYSCALL_COMPAT(shmat
);
222 COND_SYSCALL(socket
);
223 COND_SYSCALL(socketpair
);
225 COND_SYSCALL(listen
);
226 COND_SYSCALL(accept
);
227 COND_SYSCALL(connect
);
228 COND_SYSCALL(getsockname
);
229 COND_SYSCALL(getpeername
);
230 COND_SYSCALL(setsockopt
);
231 COND_SYSCALL_COMPAT(setsockopt
);
232 COND_SYSCALL(getsockopt
);
233 COND_SYSCALL_COMPAT(getsockopt
);
234 COND_SYSCALL(sendto
);
235 COND_SYSCALL(shutdown
);
236 COND_SYSCALL(recvfrom
);
237 COND_SYSCALL_COMPAT(recvfrom
);
238 COND_SYSCALL(sendmsg
);
239 COND_SYSCALL_COMPAT(sendmsg
);
240 COND_SYSCALL(recvmsg
);
241 COND_SYSCALL_COMPAT(recvmsg
);
245 /* mm/nommu.c, also with MMU */
246 COND_SYSCALL(mremap
);
248 /* security/keys/keyctl.c */
249 COND_SYSCALL(add_key
);
250 COND_SYSCALL(request_key
);
251 COND_SYSCALL(keyctl
);
252 COND_SYSCALL_COMPAT(keyctl
);
254 /* arch/example/kernel/sys_example.c */
257 COND_SYSCALL(fadvise64_64
);
259 /* mm/, CONFIG_MMU only */
260 COND_SYSCALL(swapon
);
261 COND_SYSCALL(swapoff
);
262 COND_SYSCALL(mprotect
);
265 COND_SYSCALL(munlock
);
266 COND_SYSCALL(mlockall
);
267 COND_SYSCALL(munlockall
);
268 COND_SYSCALL(mincore
);
269 COND_SYSCALL(madvise
);
270 COND_SYSCALL(remap_file_pages
);
272 COND_SYSCALL_COMPAT(mbind
);
273 COND_SYSCALL(get_mempolicy
);
274 COND_SYSCALL_COMPAT(get_mempolicy
);
275 COND_SYSCALL(set_mempolicy
);
276 COND_SYSCALL_COMPAT(set_mempolicy
);
277 COND_SYSCALL(migrate_pages
);
278 COND_SYSCALL_COMPAT(migrate_pages
);
279 COND_SYSCALL(move_pages
);
280 COND_SYSCALL_COMPAT(move_pages
);
282 COND_SYSCALL(perf_event_open
);
283 COND_SYSCALL(accept4
);
284 COND_SYSCALL(recvmmsg
);
285 COND_SYSCALL_COMPAT(recvmmsg
);
288 * Architecture specific syscalls: see further below
292 COND_SYSCALL(fanotify_init
);
293 COND_SYSCALL(fanotify_mark
);
296 COND_SYSCALL(name_to_handle_at
);
297 COND_SYSCALL(open_by_handle_at
);
298 COND_SYSCALL_COMPAT(open_by_handle_at
);
300 COND_SYSCALL(sendmmsg
);
301 COND_SYSCALL_COMPAT(sendmmsg
);
302 COND_SYSCALL(process_vm_readv
);
303 COND_SYSCALL_COMPAT(process_vm_readv
);
304 COND_SYSCALL(process_vm_writev
);
305 COND_SYSCALL_COMPAT(process_vm_writev
);
307 /* compare kernel pointers */
310 COND_SYSCALL(finit_module
);
312 /* operate on Secure Computing state */
313 COND_SYSCALL(seccomp
);
315 COND_SYSCALL(memfd_create
);
317 /* access BPF programs and maps */
321 COND_SYSCALL(execveat
);
323 COND_SYSCALL(userfaultfd
);
326 COND_SYSCALL(membarrier
);
328 COND_SYSCALL(mlock2
);
330 COND_SYSCALL(copy_file_range
);
332 /* memory protection keys */
333 COND_SYSCALL(pkey_mprotect
);
334 COND_SYSCALL(pkey_alloc
);
335 COND_SYSCALL(pkey_free
);
339 * Architecture specific weak syscall entries.
342 /* pciconfig: alpha, arm, arm64, ia64, sparc */
343 COND_SYSCALL(pciconfig_read
);
344 COND_SYSCALL(pciconfig_write
);
345 COND_SYSCALL(pciconfig_iobase
);
347 /* sys_socketcall: arm, mips, x86, ... */
348 COND_SYSCALL(socketcall
);
349 COND_SYSCALL_COMPAT(socketcall
);
351 /* compat syscalls for arm64, x86, ... */
352 COND_SYSCALL_COMPAT(sysctl
);
353 COND_SYSCALL_COMPAT(fanotify_mark
);
356 COND_SYSCALL(vm86old
);
357 COND_SYSCALL(modify_ldt
);
358 COND_SYSCALL_COMPAT(quotactl32
);
360 COND_SYSCALL(kexec_file_load
);
363 COND_SYSCALL(s390_pci_mmio_read
);
364 COND_SYSCALL(s390_pci_mmio_write
);
365 COND_SYSCALL_COMPAT(s390_ipc
);
368 cond_syscall(ppc_rtas
);
369 COND_SYSCALL(spu_run
);
370 COND_SYSCALL(spu_create
);
371 COND_SYSCALL(subpage_prot
);
375 * Deprecated system calls which are still defined in
376 * include/uapi/asm-generic/unistd.h and wanted by >= 1 arch
379 /* __ARCH_WANT_SYSCALL_NO_FLAGS */
380 COND_SYSCALL(epoll_create
);
381 COND_SYSCALL(inotify_init
);
382 COND_SYSCALL(eventfd
);
383 COND_SYSCALL(signalfd
);
384 COND_SYSCALL_COMPAT(signalfd
);
386 /* __ARCH_WANT_SYSCALL_OFF_T */
387 COND_SYSCALL(fadvise64
);
389 /* __ARCH_WANT_SYSCALL_DEPRECATED */
390 COND_SYSCALL(epoll_wait
);
392 COND_SYSCALL_COMPAT(recv
);
394 COND_SYSCALL(bdflush
);
395 COND_SYSCALL(uselib
);
399 * The syscalls below are not found in include/uapi/asm-generic/unistd.h
402 /* obsolete: SGETMASK_SYSCALL */
403 COND_SYSCALL(sgetmask
);
404 COND_SYSCALL(ssetmask
);
406 /* obsolete: SYSFS_SYSCALL */
409 /* obsolete: __ARCH_WANT_SYS_IPC */
411 COND_SYSCALL_COMPAT(ipc
);
413 /* obsolete: UID16 */
414 COND_SYSCALL(chown16
);
415 COND_SYSCALL(fchown16
);
416 COND_SYSCALL(getegid16
);
417 COND_SYSCALL(geteuid16
);
418 COND_SYSCALL(getgid16
);
419 COND_SYSCALL(getgroups16
);
420 COND_SYSCALL(getresgid16
);
421 COND_SYSCALL(getresuid16
);
422 COND_SYSCALL(getuid16
);
423 COND_SYSCALL(lchown16
);
424 COND_SYSCALL(setfsgid16
);
425 COND_SYSCALL(setfsuid16
);
426 COND_SYSCALL(setgid16
);
427 COND_SYSCALL(setgroups16
);
428 COND_SYSCALL(setregid16
);
429 COND_SYSCALL(setresgid16
);
430 COND_SYSCALL(setresuid16
);
431 COND_SYSCALL(setreuid16
);
432 COND_SYSCALL(setuid16
);