syscalls.master revision 1.28
1	$NetBSD: syscalls.master,v 1.28 2006/08/30 11:14:39 matt Exp $  
2
3;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
4
5; Derived from NetBSD's sys/compat/linux/arch/i386/syscalls.master
6; sys/compat/linux/arch/m68k/syscalls.master
7; and from Linux's arch/ppc/kernel/misc.S
8;
9; We have problems for a few syscalls, specially:
10; 142 ppc_select -> sys_new_select -> sys_select (Conflicts with 82 ???).
11;
12; Expect problems with the following, which have an architecture dependent
13; implementation in Linux/powerpc:
14; 29  pause
15; 42  pipe      tested. no problem.
16; 59  olduname
17; 101 ioperm
18; 109 uname
19; 117 ipc
20;
21; Most of syscalls after 182 that were introduced in Linux-2.4 are UNIMPL.
22;
23; The following are UNIMPL here. The Linux kernel implements them but just logs
24; a kernel error and returns -ENOSYS.
25; 110 iopl
26; 113 vm86
27; 123 modify_ldt
28; 198 sys_pciconfig_read
29; 199 sys_pciconfig_write
30; 200 sys_pciconfig_iobase
31;
32; Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
33
34; NetBSD powerpc COMPAT_LINUX system call name/number "master" file.
35; (See syscalls.conf to see what it is processed into.)
36;
37; Fields: number type [type-dependent ...]
38;	number	system call number, must be in order
39;	type	one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
40;		the compatibility options defined in syscalls.conf.
41;
42; types:
43;	STD	always included
44;	OBSOL	obsolete, not included in system
45;	UNIMPL	unimplemented, not included in system
46;	NODEF	included, but don't define the syscall number
47;	NOARGS	included, but don't define the syscall args structure
48;	INDIR	included, but don't define the syscall args structure
49;		and allow it to be "really" varargs.
50;
51; The compat options are defined in the syscalls.conf file, and the
52; compat option name is prefixed to the syscall name.  Other than
53; that, they're like NODEF (for 'compat' options), or STD (for
54; 'libcompat' options).
55;
56; The type-dependent arguments are as follows:
57; For STD, NODEF, NOARGS, and compat syscalls:
58;	{ pseudo-proto } [alias]
59; For other syscalls:
60;	[comment]
61;
62; #ifdef's, etc. may be included, and are copied to the output files.
63; #include's are copied to the syscall names and switch definition files only.
64
65#if defined(_KERNEL_OPT)
66#include "opt_compat_netbsd.h"
67#include "opt_compat_43.h"
68#include "opt_ptrace.h"
69#endif
70
71#include <sys/param.h>
72#include <sys/poll.h>
73#include <sys/systm.h>
74#include <sys/signal.h>
75#include <sys/mount.h>
76#include <sys/sa.h>
77#include <sys/syscallargs.h>
78
79#include <compat/linux/common/linux_types.h>
80#include <compat/linux/common/linux_signal.h>
81#include <compat/linux/common/linux_siginfo.h>
82#include <compat/linux/common/linux_machdep.h>
83#include <compat/linux/common/linux_mmap.h>
84
85#include <compat/linux/linux_syscallargs.h>
86
87%%
88
890	NOARGS		{ int linux_sys_nosys(void); } syscall
901	NOARGS		{ int sys_exit(int rval); }
912	NOARGS		{ int sys_fork(void); }
923	NOARGS		{ int sys_read(int fd, char *buf, u_int nbyte); }
934	NOARGS		{ int sys_write(int fd, char *buf, u_int nbyte); }
945	STD		{ int linux_sys_open(const char *path, int flags, \
95			    int mode); }
966	NOARGS		{ int sys_close(int fd); }
977	STD		{ int linux_sys_waitpid(int pid, int *status, \
98			    int options);}
998	STD		{ int linux_sys_creat(const char *path, int mode); }
1009	STD		{ int linux_sys_link(const char *path, const \
101			    char *link); }
10210	STD		{ int linux_sys_unlink(const char *path); }
10311	STD		{ int linux_sys_execve(const char *path, char **argp, \
104			    char **envp); }
10512	STD		{ int linux_sys_chdir(const char *path); }
10613	STD		{ int linux_sys_time(linux_time_t *t); }
10714	STD		{ int linux_sys_mknod(const char *path, int mode, \
108			    int dev); }
10915	STD		{ int linux_sys_chmod(const char *path, int mode); }
11016	STD		{ int linux_sys_lchown(const char *path, int uid, \
111			    int gid); }
11217	OBSOL		break
11318	OBSOL		ostat
11419	NOARGS		{ long compat_43_sys_lseek(int fd, long offset, \
115			    int whence); }
11620	NOARGS MPSAFE	{ pid_t sys_getpid(void); }
11721	UNIMPL		mount
11822	OBSOL		umount
11923	NOARGS		{ int sys_setuid(uid_t uid); }
12024	NOARGS		{ uid_t sys_getuid(void); }
12125	STD		{ int linux_sys_stime(linux_time_t *t); }
122#ifdef PTRACE
12326	STD		{ int linux_sys_ptrace(int request, int pid, \
124			    int addr, int data); }
125#else
12626	EXCL		ptrace
127#endif
12827	STD		{ int linux_sys_alarm(unsigned int secs); }
12928	OBSOL		ofstat
13029	STD		{ int linux_sys_pause(void); }
13130	STD		{ int linux_sys_utime(const char *path, \
132			    struct linux_utimbuf *times); }
13331	OBSOL		stty
13432	OBSOL		gtty
13533	STD		{ int linux_sys_access(const char *path, int flags); }
13634	STD		{ int linux_sys_nice(int incr); }
13735	OBSOL		ftime
13836	NOARGS		{ int sys_sync(void); }
13937	STD		{ int linux_sys_kill(int pid, int signum); }
14038	STD		{ int linux_sys_rename(const char *from, \
141			    const char *to); }
14239	STD		{ int linux_sys_mkdir(const char *path, int mode); }
14340	STD		{ int linux_sys_rmdir(const char *path); }
14441	NOARGS		{ int sys_dup(u_int fd); }
14542	STD		{ int linux_sys_pipe(int *pfds); }
14643	STD		{ int linux_sys_times(struct times *tms); }
14744	OBSOL		prof
14845	STD		{ int linux_sys_brk(char *nsize); }
14946	NOARGS		{ int sys_setgid(gid_t gid); }
15047	NOARGS		{ gid_t sys_getgid(void); }
15148	STD		{ int linux_sys_signal(int signum, \
152			    linux_handler_t handler); }
15349	NOARGS		{ uid_t sys_geteuid(void); }
15450	NOARGS		{ gid_t sys_getegid(void); }
15551	NOARGS		{ int sys_acct(char *path); }
15652	UNIMPL		umount
15753	OBSOL		lock
15854	STD		{ int linux_sys_ioctl(int fd, u_long com, \
159			    caddr_t data); }
16055	STD		{ int linux_sys_fcntl(int fd, int cmd, void *arg); }
16156	OBSOL		mpx
16257	NOARGS		{ int sys_setpgid(int pid, int pgid); }
16358	OBSOL		ulimit
16459 	STD		{ int linux_sys_olduname(struct linux_old_utsname \
165			   *up); }
16660	NOARGS		{ int sys_umask(int newmask); }
16761	NOARGS		{ int sys_chroot(char *path); }
16862	UNIMPL		ustat
16963	NOARGS		{ int sys_dup2(u_int from, u_int to); }
17064	NOARGS		{ pid_t sys_getppid(void); }
17165	NOARGS		{ int sys_getpgrp(void); }
17266	NOARGS		{ int sys_setsid(void); }
17367	STD		{ int linux_sys_sigaction(int signum, \
174			    const struct linux_old_sigaction *nsa, \
175			    struct linux_old_sigaction *osa); }
17668	STD		{ int linux_sys_siggetmask(void); }
17769	STD		{ int linux_sys_sigsetmask(linux_old_sigset_t mask); }
17870	NOARGS		{ int sys_setreuid(uid_t ruid, uid_t euid); }
17971	NOARGS		{ int sys_setregid(gid_t rgid, gid_t egid); }
18072	STD		{ int linux_sys_sigsuspend(caddr_t restart, \
181			    int oldmask, int mask); }
18273	STD		{ int linux_sys_sigpending(linux_old_sigset_t *set); }
18374	NOARGS		{ int compat_43_sys_sethostname(char *hostname, \
184			    u_int len);}
18575	STD		{ int linux_sys_setrlimit(u_int which, \
186			    struct orlimit *rlp); }
18776	STD		{ int linux_sys_getrlimit(u_int which, \
188			    struct orlimit *rlp); }
18977	NOARGS		{ int sys_getrusage(int who, struct rusage *rusage); }
19078	STD		{ int linux_sys_gettimeofday(struct timeval *tp, \
191			    struct timezone *tzp); }
19279	STD		{ int linux_sys_settimeofday(struct timeval *tp, \
193			    struct timezone *tzp); }
19480	NOARGS		{ int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
19581	NOARGS		{ int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
19682	STD		{ int linux_sys_select(int nfds, fd_set* readfds, \
197					fd_set* writefds, fd_set* exceptfds, \
198					struct timeval *timeout); }
19983	STD		{ int linux_sys_symlink(const char *path, \
200			    const char *to); }
20184	NOARGS		{ int compat_43_sys_lstat(const char *path, \
202			    struct stat43 *up); } oolstat
20385	STD		{ int linux_sys_readlink(const char *name, char *buf, \
204			    int count); }
205#ifdef EXEC_AOUT
20686	STD		{ int linux_sys_uselib(const char *path); }
207#else
20886	UNIMPL		sys_uselib
209#endif
21087	STD		{ int linux_sys_swapon(char *name); }
21188	STD		{ int linux_sys_reboot(int magic1, int magic2, \
212			    int cmd, void *arg); }
21389	STD		{ int linux_sys_readdir(int fd, caddr_t dent, \
214			    unsigned int count); }
21590	NOARGS		{ int linux_sys_mmap(unsigned long addr, size_t len, \
216			    int prot, int flags, int fd, linux_off_t offset); }
21791	NOARGS		{ int sys_munmap(caddr_t addr, int len); }
21892	STD		{ int linux_sys_truncate(const char *path, \
219			    long length); }
22093	NOARGS		{ int compat_43_sys_ftruncate(int fd, long length); }
22194	NOARGS		{ int sys_fchmod(int fd, int mode); }
22295	NOARGS		{ int sys___posix_fchown(int fd, int uid, int gid); }
22396	STD		{ int linux_sys_getpriority(int which, int who); }
22497	NOARGS		{ int sys_setpriority(int which, int who, int prio); }
22598	NOARGS		{ int sys_profil(caddr_t samples, u_int size, \
226			    u_int offset, u_int scale); }
22799	STD		{ int linux_sys_statfs(const char *path, \
228			    struct linux_statfs *sp); }
229100	STD		{ int linux_sys_fstatfs(int fd, \
230			    struct linux_statfs *sp); }
231101	STD		{ int linux_sys_ioperm(unsigned int lo, \
232			    unsigned int hi, int val); }
233102	STD		{ int linux_sys_socketcall(int what, void *args); }
234103	UNIMPL		syslog
235104	NOARGS		{ int sys_setitimer(u_int which, \
236			    struct itimerval *itv, struct itimerval *oitv); }
237105	NOARGS		{ int sys_getitimer(u_int which, \
238			    struct itimerval *itv); }
239106	STD		{ int linux_sys_stat(const char *path, \
240			    struct linux_stat *sp); }
241107	STD		{ int linux_sys_lstat(const char *path, \
242			    struct linux_stat *sp); }
243108	STD		{ int linux_sys_fstat(int fd, struct linux_stat *sp); }
244109	STD		{ int linux_sys_uname(struct linux_utsname *up); }
245110	UNIMPL		iopl
246111	UNIMPL		vhangup
247112	UNIMPL		idle
248113	UNIMPL		vm86old
249114	STD		{ int linux_sys_wait4(int pid, int *status, \
250			    int options, struct rusage *rusage); }
251115	STD		{ int linux_sys_swapoff(const char *path); }
252116	STD		{ int linux_sys_sysinfo(struct linux_sysinfo *arg); }
253117	STD		{ int linux_sys_ipc(int what, int a1, int a2, int a3, \
254			    caddr_t ptr); }
255118	NOARGS		{ int sys_fsync(int fd); }
256119	STD		{ int linux_sys_sigreturn(struct linux_sigcontext *scp); }
257120	STD		{ int linux_sys_clone(int flags, void *stack); }
258121	STD		{ int linux_sys_setdomainname(char *domainname, \
259			    int len); }
260122	STD		{ int linux_sys_new_uname(struct linux_utsname *up); }
261123	UNIMPL		modify_ldt
262124	UNIMPL		adjtimex
263125	STD		{ int linux_sys_mprotect(const void *start, \
264			    unsigned long len, int prot); }
265126	STD		{ int linux_sys_sigprocmask(int how, \
266			    const linux_old_sigset_t *set, \
267			    linux_old_sigset_t *oset); }
268127	UNIMPL		create_module
269128	UNIMPL		init_module
270129	UNIMPL		delete_module
271130	UNIMPL		get_kernel_syms
272131	UNIMPL		quotactl
273132	STD		{ int linux_sys_getpgid(int pid); }
274133	NOARGS		{ int sys_fchdir(int fd); }
275134	UNIMPL		bdflush
276135	UNIMPL		sysfs
277136	STD		{ int linux_sys_personality(int per); }
278137	UNIMPL		afs_syscall
279138	STD		{ int linux_sys_setfsuid(uid_t uid); }
280139	NOARGS		{ int linux_sys_getfsuid(void); }
281140	STD		{ int linux_sys_llseek(int fd, u_int32_t ohigh, \
282			    u_int32_t olow, caddr_t res, int whence); }
283141	STD		{ int linux_sys_getdents(int fd, \
284			    struct linux_dirent *dent, unsigned int count); }
285142	STD		{ int linux_sys_new_select(int nfds, fd_set *readfds, \
286			    fd_set *writefds, fd_set *exceptfds, \
287			    struct timeval *timeout); }
288143	NOARGS		{ int sys_flock(int fd, int how); }
289144	STD		{ int linux_sys_msync(caddr_t addr, int len, int fl); }
290145	NOARGS		{ int sys_readv(int fd, struct iovec *iovp, \
291				u_int iovcnt); }
292146	NOARGS		{ int sys_writev(int fd, struct iovec *iovp, \
293				u_int iovcnt); }
294147	NOARGS		{ pid_t sys_getsid(pid_t pid); }
295148	STD		{ int linux_sys_fdatasync(int fd); }
296149	STD		{ int linux_sys___sysctl(struct linux___sysctl *lsp); }
297150	NOARGS		{ int sys_mlock(caddr_t addr, size_t len); }
298151	NOARGS		{ int sys_munlock(caddr_t addr, size_t len); }
299152	NOARGS		{ int sys_mlockall(int flags); }
300153	NOARGS		{ int sys_munlockall(void); }
301154	STD		{ int linux_sys_sched_setparam(pid_t pid, \
302			    const struct linux_sched_param *sp); }
303155	STD		{ int linux_sys_sched_getparam(pid_t pid, \
304			    struct linux_sched_param *sp); }
305156	STD		{ int linux_sys_sched_setscheduler(pid_t pid, \
306			    int policy, const struct linux_sched_param *sp); }
307157	STD		{ int linux_sys_sched_getscheduler(pid_t pid); }
308158	STD		{ int linux_sys_sched_yield(void); }
309159	STD		{ int linux_sys_sched_get_priority_max(int policy); }
310160	STD		{ int linux_sys_sched_get_priority_min(int policy); }
311161	UNIMPL		sched_rr_get_interval
312162	NOARGS		{ int sys_nanosleep(const struct timespec *rqtp, \
313				struct timespec *rmtp); }
314163	STD		{ void *linux_sys_mremap(void *old_address, \
315			    size_t old_size, size_t new_size, u_long flags); }
316164	STD		{ int linux_sys_setresuid(uid_t ruid, uid_t euid, \
317			    uid_t suid); }
318165	STD		{ int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \
319			    uid_t *suid); }
320166	UNIMPL		query_module
321167	NOARGS		{ int sys_poll(struct pollfd *fds, u_int nfds, \
322			    int timeout); }
323168	UNIMPL		nfsservctl
324169	STD		{ int linux_sys_setresgid(gid_t rgid, gid_t egid, \
325			    gid_t sgid); }
326170	STD		{ int linux_sys_getresgid(gid_t *rgid, gid_t *egid, \
327			    gid_t *sgid); }
328171	UNIMPL		prctl
329172	STD		{ int linux_sys_rt_sigreturn( \
330			    struct linux_rt_sigframe *sfp); }
331173	STD		{ int linux_sys_rt_sigaction(int signum, \
332			    const struct linux_sigaction *nsa, \
333			    struct linux_sigaction *osa, \
334			    size_t sigsetsize); }
335174	STD		{ int linux_sys_rt_sigprocmask(int how, \
336			    const linux_sigset_t *set, \
337			    linux_sigset_t *oset, \
338			    size_t sigsetsize); }
339175	STD		{ int linux_sys_rt_sigpending( \
340			    linux_sigset_t *set, \
341			    size_t sigsetsize); }
342176	UNIMPL		rt_sigtimedwait
343; XXX XAX int here?  sigset_t here?  siginfo_t
344177	STD		{ int linux_sys_rt_queueinfo(int pid, int signum, \
345			    void *uinfo); }
346178	STD		{ int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
347			    size_t sigsetsize); }
348179	STD		{ int linux_sys_pread(int fd, char *buf, \
349			    size_t nbyte, linux_off_t offset); }
350180	STD		{ int linux_sys_pwrite(int fd, char *buf, \
351			    size_t nbyte, linux_off_t offset); }
352181	STD		{ int linux_sys_chown(const char *path, \
353			    int uid, int gid); }
354182	NOARGS		{ int sys___getcwd(char *bufp, size_t length); }
355183	UNIMPL		capget
356184	UNIMPL		capset
357185	STD		{ int linux_sys_sigaltstack( \
358			    const struct linux_sigaltstack *ss, \
359			    struct linux_sigaltstack *oss); }
360186	UNIMPL		sendfile
361187	UNIMPL		getpmsg
362188	UNIMPL		putpmsg
363189	NOARGS		{ int sys___vfork14(void); }
364190	STD		{ int linux_sys_ugetrlimit(int which, \
365			    struct rlimit *rlp); }
366191	UNIMPL		/* unused */
367192	NOARGS		{ linux_off_t linux_sys_mmap2(unsigned long addr, \
368			    size_t len, int prot, int flags, int fd, \
369			    linux_off_t offset); }
370193	STD		{ int linux_sys_truncate64(const char *path, \
371			    off_t length); }
372194	STD		{ int linux_sys_ftruncate64(unsigned int fd, \
373			    off_t length); }
374195	STD		{ int linux_sys_stat64(const char *path, \
375			    struct linux_stat64 *sp); }
376196	STD		{ int linux_sys_lstat64(const char *path, \
377			    struct linux_stat64 *sp); }
378197	STD		{ int linux_sys_fstat64(int fd, \
379			    struct linux_stat64 *sp); }
380198	UNIMPL		sys_pciconfig_read
381199	UNIMPL		sys_pciconfig_write
382200	UNIMPL		sys_pciconfig_iobase
383201	UNIMPL		/* Unused (MacOnLinux project) */
384202	STD		{ int linux_sys_getdents64(int fd, \
385			    struct linux_dirent64 *dent, unsigned int count); }
386203	UNIMPL		pivot_root
387204	STD		{ int linux_sys_fcntl64(int fd, int cmd, void *arg); }
388205	NOARGS		{ int sys_mincore(void *addr, size_t len, char *vec); }
389206	NOARGS		{ int sys_madvise(void *addr, size_t len, int behav); }
390207	UNIMPL		gettid
391208	UNIMPL		tkill
392209	STD		{ int linux_sys_setxattr(char *path, char *name, \
393			    void *value, size_t size, int flags); }
394210	STD		{ int linux_sys_lsetxattr(char *path, char *name, \
395			    void *value, size_t size, int flags); }
396211	STD		{ int linux_sys_fsetxattr(int fd, char *name, \
397			    void *value, size_t size, int flags); }
398212	STD		{ ssize_t linux_sys_getxattr(char *path, char *name, \
399			    void *value, size_t size); }
400213	STD		{ ssize_t linux_sys_lgetxattr(char *path, char *name, \
401			    void *value, size_t size); }
402214	STD		{ ssize_t linux_sys_fgetxattr(int fd, char *name, \
403			    void *value, size_t size); }
404215	STD		{ ssize_t linux_sys_listxattr(char *path, char *list, \
405			    size_t size); }
406216	STD		{ ssize_t linux_sys_llistxattr(char *path, char *list, \
407			    size_t size); }
408217	STD		{ ssize_t linux_sys_flistxattr(int fd, char *list, \
409			    size_t size); }
410218	STD		{ int linux_sys_removexattr(char *path, char *name); }
411219	STD		{ int linux_sys_lremovexattr(char *path, char *name); }
412220	STD		{ int linux_sys_fremovexattr(int fd, char *name); }
413221	UNIMPL		futex
414222	UNIMPL		sched_setaffinity
415223	UNIMPL		sched_getaffinity
416224	UNIMPL		/* unused */
417225	UNIMPL		tuxcall
418226	UNIMPL		sendfile64
419227	UNIMPL		io_setup
420228	UNIMPL		io_destroy
421229	UNIMPL		io_getevents
422230	UNIMPL		io_submit
423231	UNIMPL		io_cancel
424232	UNIMPL		set_tid_address
425233	UNIMPL		fadvise64
426234	STD		{ int linux_sys_exit_group(int error_code); }
427235	UNIMPL		lookup_dcookie
428236	UNIMPL		epoll_create
429237	UNIMPL		epoll_ctl
430238	UNIMPL		epoll_wait
431239	UNIMPL		remap_file_pages
432240	UNIMPL		timer_create
433241	UNIMPL		timer_settime
434242	UNIMPL		timer_gettime
435243	UNIMPL		timer_getoverrun
436244	UNIMPL		timer_delete
437245	STD		{ int linux_sys_clock_settime(clockid_t which, \
438			    struct linux_timespec *tp); }
439246	STD		{ int linux_sys_clock_gettime(clockid_t which, \
440			    struct linux_timespec *tp); }
441247	STD		{ int linux_sys_clock_getres(clockid_t which, \
442			    struct linux_timespec *tp); }
443248	STD		{ int linux_sys_clock_nanosleep(clockid_t which, \
444			    int flags, struct linux_timespec *rqtp, \
445			    struct linux_timespec *rmtp); }
446249	UNIMPL		swapcontext
447250	UNIMPL		tgkill
448251	UNIMPL		utimes
449252	STD		{ int linux_sys_statfs64(const char *path, \
450			    size_t sz, struct linux_statfs64 *sp); }
451253	STD		{ int linux_sys_fstatfs64(int fd, \
452			    size_t sz, struct linux_statfs64 *sp); }
453254	UNIMPL		fadvise64_64
454255	UNIMPL		rtas
455256	UNIMPL		/* reserved for sys_debug_setcontext */
456257	UNIMPL		/* reserved for vserver */
457258	UNIMPL		/* reserved for new sys_remap_file_pages */
458259	UNIMPL		/* reserved for new sys_mbind */
459260	UNIMPL		/* reserved for new sys_get_mempolicy */
460261	UNIMPL		/* reserved for new sys_set_mempolicy */
461262	UNIMPL		mq_open
462263	UNIMPL		mq_unlink
463264	UNIMPL		mq_timedsend
464265	UNIMPL		mq_timedreceive
465266	UNIMPL		mq_notify
466267	UNIMPL		mq_getsetattr
467268	UNIMPL		kexec_load
468