blob: 18984b222375e4b5d4a306d0be6ee6f9a673330d [file] [log] [blame]
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001/*
2 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
3 * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $Id$
29 */
30
31#include "dummy.h"
32
33/* primary syscalls */
34
Roland McGrath79dcd7a2006-01-12 22:34:50 +000035int sys_restart_syscall();
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000036int sys_setup(), sys_exit(), sys_fork(), sys_read(), sys_write();
37int sys_open(), sys_close(), sys_waitpid(), sys_creat(), sys_link();
38int sys_unlink(), sys_execve(), sys_chdir(), sys_time(), sys_mknod();
39int sys_chmod(), sys_chown(), sys_break(), sys_oldstat();
Wichert Akkermandacfb6e1999-06-03 14:21:07 +000040int sys_lseek(), sys_getpid(), sys_mount(), sys_umount(), sys_umount2();
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000041int sys_setuid(), sys_getuid(), sys_stime(), sys_ptrace();
42int sys_alarm(), sys_oldfstat(), sys_pause(), sys_utime();
43int sys_stty(), sys_gtty(), sys_access(), sys_nice(), sys_ftime();
44int sys_sync(), sys_kill(), sys_rename(), sys_mkdir(), sys_rmdir();
45int sys_dup(), sys_pipe(), sys_times(), sys_prof(), sys_brk();
46int sys_setgid(), sys_getgid(), sys_signal(), sys_geteuid();
47int sys_getegid(), sys_acct(), sys_phys(), sys_lock(), sys_ioctl();
48int sys_fcntl(), sys_mpx(), sys_setpgid(), sys_ulimit();
49int sys_olduname(), sys_umask(), sys_chroot(), sys_ustat();
50int sys_dup2(), sys_getppid(), sys_getpgrp(), sys_setsid();
51int sys_sigaction(), sys_siggetmask(), sys_sigsetmask();
52int sys_setreuid(), sys_setregid(), sys_sigsuspend();
53int sys_sigpending(), sys_sethostname(), sys_setrlimit();
54int sys_getrlimit(), sys_getrusage(), sys_gettimeofday();
55int sys_settimeofday(), sys_getgroups(), sys_setgroups();
Roland McGratha44c82a2003-11-13 22:32:25 +000056int sys_setgroups32(), sys_getgroups32();
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000057int sys_oldselect(), sys_symlink(), sys_oldlstat(), sys_readlink();
58int sys_uselib(), sys_swapon(), sys_reboot(), sys_readdir();
59int sys_mmap(), sys_munmap(), sys_truncate(), sys_ftruncate();
60int sys_fchmod(), sys_fchown(), sys_getpriority();
61int sys_setpriority(), sys_profil(), sys_statfs(), sys_fstatfs();
62int sys_ioperm(), sys_socketcall(), sys_syslog(), sys_setitimer();
63int sys_getitimer(), sys_stat(), sys_lstat(), sys_fstat();
64int sys_uname(), sys_iopl(), sys_vhangup(), sys_idle(), sys_vm86();
65int sys_wait4(), sys_swapoff(), sys_ipc(), sys_sigreturn();
66int sys_fsync(), sys_clone(), sys_setdomainname(), sys_sysinfo();
67int sys_modify_ldt(), sys_adjtimex(), sys_mprotect();
68int sys_sigprocmask(), sys_create_module(), sys_init_module();
69int sys_delete_module(), sys_get_kernel_syms(), sys_quotactl();
70int sys_getpgid(), sys_fchdir(), sys_bdflush();
71int sys_sysfs(), sys_personality(), sys_afs_syscall();
72int sys_setfsuid(), sys_setfsgid(), sys_llseek();
73int sys_getdents(), sys_flock(), sys_msync();
74int sys_readv(), sys_writev(), sys_select();
75int sys_getsid(), sys_fdatasync(), sys_sysctl();
Wichert Akkermanc7926982000-04-10 22:22:31 +000076int sys_mlock(), sys_munlock(), sys_mlockall(), sys_munlockall(), sys_madvise();
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000077int sys_sched_setparam(), sys_sched_getparam();
78int sys_sched_setscheduler(), sys_sched_getscheduler(), sys_sched_yield();
79int sys_sched_get_priority_max(), sys_sched_get_priority_min();
80int sys_sched_rr_get_interval(), sys_nanosleep(), sys_mremap();
81int sys_sendmsg(), sys_recvmsg(), sys_setresuid(), sys_setresgid();
82int sys_getresuid(), sys_getresgid(), sys_pread(), sys_pwrite(), sys_getcwd();
83int sys_sigaltstack(), sys_rt_sigprocmask(), sys_rt_sigaction();
84int sys_rt_sigpending(), sys_rt_sigsuspend(), sys_rt_sigqueueinfo();
85int sys_rt_sigtimedwait(), sys_prctl(), sys_poll(), sys_vfork();
Ulrich Drepper75bb37c1999-12-24 07:59:50 +000086int sys_sendfile(), sys_old_mmap(), sys_stat64(), sys_lstat64(), sys_fstat64();
Wichert Akkermanc7926982000-04-10 22:22:31 +000087int sys_truncate64(), sys_ftruncate64(), sys_pivotroot();
Roland McGrath9677b3a2003-03-12 09:54:36 +000088int sys_getdents64();
Roland McGrath2c71e0d2002-12-15 23:58:19 +000089int sys_getpmsg(), sys_putpmsg(), sys_readahead(), sys_sendfile64();
90int sys_setxattr(), sys_fsetxattr(), sys_getxattr(), sys_fgetxattr();
91int sys_listxattr(), sys_flistxattr(), sys_removexattr(), sys_fremovexattr();
92int sys_sched_setaffinity(), sys_sched_getaffinity(), sys_futex();
Roland McGrath72c5b7b2003-03-05 04:08:00 +000093int sys_set_thread_area(), sys_get_thread_area(), sys_remap_file_pages();
Roland McGrath1e356792003-03-30 23:52:28 +000094int sys_timer_create(), sys_timer_delete(), sys_timer_getoverrun();
95int sys_timer_gettime(), sys_timer_settime(), sys_clock_settime();
96int sys_clock_gettime(), sys_clock_getres(), sys_clock_nanosleep();
Roland McGrathab147c52003-07-17 09:03:02 +000097int sys_semtimedop(), sys_statfs64(), sys_fstatfs64(), sys_tgkill();
Roland McGrathd4c85eb2004-04-16 21:48:44 +000098int sys_mq_open(), sys_mq_timedsend(), sys_mq_timedreceive();
99int sys_mq_notify(), sys_mq_getsetattr();
Roland McGrath93817bf2004-10-06 22:23:31 +0000100int sys_epoll_create(), sys_epoll_ctl(), sys_epoll_wait();
Roland McGrathdf13e8f2004-10-07 18:51:19 +0000101int sys_waitid(), sys_fadvise64(), sys_fadvise64_64();
Roland McGrathb10a3352004-10-07 18:53:12 +0000102int sys_mbind(), sys_get_mempolicy(), sys_set_mempolicy();
Roland McGrath1f1c54a2005-02-02 04:16:52 +0000103int sys_arch_prctl();
Roland McGrath37b9f842005-05-09 08:02:00 +0000104int sys_io_setup(), sys_io_submit(), sys_io_cancel(), sys_io_getevents(), sys_io_destroy();
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000105
106/* sys_socketcall subcalls */
107
108int sys_socket(), sys_bind(), sys_connect(), sys_listen();
109int sys_accept(), sys_getsockname(), sys_getpeername(), sys_socketpair();
110int sys_send(), sys_recv(), sys_sendto(), sys_recvfrom();
111int sys_shutdown(), sys_setsockopt(), sys_getsockopt();
112
Dmitry V. Levin95ebf5a2006-10-13 20:25:12 +0000113/* *at syscalls */
114int sys_fchmodat();
115int sys_newfstatat();
116int sys_unlinkat();
117int sys_fchownat();
118int sys_openat();
119int sys_renameat();
120int sys_symlinkat();
121int sys_readlinkat();
122int sys_linkat();
123int sys_faccessat();
124int sys_mkdirat();
125int sys_mknodat();
126int sys_futimesat();
127
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000128/* new ones */
129int sys_query_module();
130int sys_poll();
Michal Ludvig10a88d02002-10-07 14:31:00 +0000131int sys_mincore();
Dmitry V. Levin95ebf5a2006-10-13 20:25:12 +0000132int sys_inotify_add_watch();
133int sys_inotify_rm_watch();
134int sys_pselect6();
135int sys_ppoll();
136int sys_unshare();
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000137
Wichert Akkerman0ae852b1999-11-18 17:12:55 +0000138/* architecture-specific calls */
139#ifdef ALPHA
Wichert Akkerman221f54f1999-11-18 17:26:45 +0000140int sys_osf_select();
141int sys_osf_gettimeofday();
142int sys_osf_settimeofday();
143int sys_osf_getitimer();
144int sys_osf_setitimer();
145int sys_osf_getrusage();
146int sys_osf_wait4();
147int sys_osf_utimes();
Wichert Akkerman0ae852b1999-11-18 17:12:55 +0000148#endif
149
150
Roland McGrathe69b6272005-06-07 23:21:28 +0000151#ifndef SYS_waitid
152# ifdef I386
153# define SYS_waitid 284
154# elif defined ALPHA
155# define SYS_waitid 438
156# elif defined ARM
157# define SYS_waitid (NR_SYSCALL_BASE + 280)
158# elif defined IA64
159# define SYS_waitid 1270
160# elif defined M68K
161# define SYS_waitid 277
162# elif defined POWERPC
163# define SYS_waitid 272
164# elif defined S390 || defined S390X
165# define SYS_waitid 281
166# elif defined SH64
167# define SYS_waitid 312
168# elif defined SH64
169# define SYS_waitid 312
170# elif defined SH
171# define SYS_waitid 284
172# elif defined SPARC || defined SPARC64
173# define SYS_waitid 279
174# elif defined X86_64
175# define SYS_waitid 247
176# endif
177#endif
178
179#if !defined(ALPHA) && !defined(MIPS) && !defined(HPPA)
Wichert Akkerman7b3346b2001-10-09 23:47:38 +0000180# ifdef IA64
181/*
182 * IA64 syscall numbers (the only ones available from standard header
183 * files) are disjoint from IA32 syscall numbers. We need to define
184 * the IA32 socket call number here.
185 */
186# define SYS_socketcall 102
187
188# undef SYS_socket
189# undef SYS_bind
190# undef SYS_connect
191# undef SYS_listen
192# undef SYS_accept
193# undef SYS_getsockname
194# undef SYS_getpeername
195# undef SYS_socketpair
196# undef SYS_send
197# undef SYS_recv
198# undef SYS_sendto
199# undef SYS_recvfrom
200# undef SYS_shutdown
201# undef SYS_setsockopt
202# undef SYS_getsockopt
203# undef SYS_sendmsg
204# undef SYS_recvmsg
Roland McGrath09f0d1d2002-12-22 03:34:39 +0000205# endif /* IA64 */
Roland McGrathfeb83812006-08-22 06:06:12 +0000206# define SYS_socket_subcall 400
Roland McGrathe69b6272005-06-07 23:21:28 +0000207#define SYS_sub_socket (SYS_socket_subcall + 1)
208#define SYS_sub_bind (SYS_socket_subcall + 2)
209#define SYS_sub_connect (SYS_socket_subcall + 3)
210#define SYS_sub_listen (SYS_socket_subcall + 4)
211#define SYS_sub_accept (SYS_socket_subcall + 5)
212#define SYS_sub_getsockname (SYS_socket_subcall + 6)
213#define SYS_sub_getpeername (SYS_socket_subcall + 7)
214#define SYS_sub_socketpair (SYS_socket_subcall + 8)
215#define SYS_sub_send (SYS_socket_subcall + 9)
216#define SYS_sub_recv (SYS_socket_subcall + 10)
217#define SYS_sub_sendto (SYS_socket_subcall + 11)
218#define SYS_sub_recvfrom (SYS_socket_subcall + 12)
219#define SYS_sub_shutdown (SYS_socket_subcall + 13)
220#define SYS_sub_setsockopt (SYS_socket_subcall + 14)
221#define SYS_sub_getsockopt (SYS_socket_subcall + 15)
222#define SYS_sub_sendmsg (SYS_socket_subcall + 16)
223#define SYS_sub_recvmsg (SYS_socket_subcall + 17)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000224
Wichert Akkerman0ae852b1999-11-18 17:12:55 +0000225#define SYS_socket_nsubcalls 18
Roland McGrathe69b6272005-06-07 23:21:28 +0000226#endif /* !(ALPHA || MIPS || HPPA) */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000227
228/* sys_ipc subcalls */
229
Wichert Akkermane5be0de1999-12-14 10:46:18 +0000230int sys_semget(), sys_semctl(), sys_semop();
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000231int sys_msgsnd(), sys_msgrcv(), sys_msgget(), sys_msgctl();
232int sys_shmat(), sys_shmdt(), sys_shmget(), sys_shmctl();
233
Roland McGrathe69b6272005-06-07 23:21:28 +0000234#if !defined(ALPHA) && !defined(MIPS) && !defined(SPARC) && !defined(HPPA)
Wichert Akkerman7b3346b2001-10-09 23:47:38 +0000235# ifdef IA64
236 /*
237 * IA64 syscall numbers (the only ones available from standard
238 * header files) are disjoint from IA32 syscall numbers. We need
239 * to define the IA32 socket call number here. Fortunately, this
240 * symbol, `SYS_ipc', is not used by any of the IA64 code so
241 * re-defining this symbol will not cause a problem.
242 */
243# undef SYS_ipc
244# define SYS_ipc 117
245# undef SYS_semop
246# undef SYS_semget
247# undef SYS_semctl
Roland McGrathf01185e2005-02-02 03:42:51 +0000248# undef SYS_semtimedop
Wichert Akkerman7b3346b2001-10-09 23:47:38 +0000249# undef SYS_msgsnd
250# undef SYS_msgrcv
251# undef SYS_msgget
252# undef SYS_msgctl
253# undef SYS_shmat
254# undef SYS_shmdt
255# undef SYS_shmget
256# undef SYS_shmctl
257# endif /* IA64 */
Roland McGrath2c71e0d2002-12-15 23:58:19 +0000258#define SYS_ipc_subcall ((SYS_socket_subcall)+(SYS_socket_nsubcalls))
Roland McGrathe69b6272005-06-07 23:21:28 +0000259#define SYS_sub_semop (SYS_ipc_subcall + 1)
260#define SYS_sub_semget (SYS_ipc_subcall + 2)
261#define SYS_sub_semctl (SYS_ipc_subcall + 3)
262#define SYS_sub_semtimedop (SYS_ipc_subcall + 4)
263#define SYS_sub_msgsnd (SYS_ipc_subcall + 11)
264#define SYS_sub_msgrcv (SYS_ipc_subcall + 12)
265#define SYS_sub_msgget (SYS_ipc_subcall + 13)
266#define SYS_sub_msgctl (SYS_ipc_subcall + 14)
267#define SYS_sub_shmat (SYS_ipc_subcall + 21)
268#define SYS_sub_shmdt (SYS_ipc_subcall + 22)
269#define SYS_sub_shmget (SYS_ipc_subcall + 23)
270#define SYS_sub_shmctl (SYS_ipc_subcall + 24)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000271
272#define SYS_ipc_nsubcalls 25
Roland McGrathe69b6272005-06-07 23:21:28 +0000273#endif /* !(ALPHA || MIPS || SPARC || HPPA) */
274
275#if defined SYS_ipc_subcall && !defined SYS_ipc
276# define SYS_ipc SYS_ipc_subcall
277#endif
278#if defined SYS_socket_subcall && !defined SYS_socketcall
279# define SYS_socketcall SYS_socket_subcall
280#endif
Wichert Akkerman7b3346b2001-10-09 23:47:38 +0000281
282#ifdef IA64
283 /*
284 * IA64 syscall numbers (the only ones available from standard header
285 * files) are disjoint from IA32 syscall numbers. We need to define
286 * some IA32 specific syscalls here.
287 */
288# define SYS_fork 2
289# define SYS_vfork 190
290# define SYS32_exit 1
291# define SYS_waitpid 7
292# define SYS32_wait4 114
293# define SYS32_execve 11
294#endif /* IA64 */
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +0000295
296#if defined(ALPHA) || defined(IA64)
297int sys_getpagesize();
298#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000299
300#ifdef ALPHA
Wichert Akkermanc7926982000-04-10 22:22:31 +0000301int osf_statfs(), osf_fstatfs();
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +0000302#endif
303
304#ifdef IA64
305int sys_getpmsg(), sys_putpmsg(); /* STREAMS stuff */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000306#endif
307
Wichert Akkerman0cbfb322001-02-19 13:35:53 +0000308#ifdef MIPS
Wichert Akkermand6b92492001-04-07 21:37:12 +0000309int sys_sysmips();
Wichert Akkerman0cbfb322001-02-19 13:35:53 +0000310#endif
311
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000312int sys_setpgrp(), sys_gethostname(), sys_getdtablesize(), sys_utimes();
313int sys_capget(), sys_capset();
314
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000315#ifdef M68K
316int sys_cacheflush();
317#endif