syscalls.master revision 1.24
1	$NetBSD: syscalls.master,v 1.24 2005/10/18 18:37:44 joerg 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#endif
69
70#include <sys/param.h>
71#include <sys/poll.h>
72#include <sys/systm.h>
73#include <sys/signal.h>
74#include <sys/mount.h>
75#include <sys/sa.h>
76#include <sys/syscallargs.h>
77
78#include <compat/linux/common/linux_types.h>
79#include <compat/linux/common/linux_signal.h>
80#include <compat/linux/common/linux_siginfo.h>
81#include <compat/linux/common/linux_machdep.h>
82#include <compat/linux/common/linux_mmap.h>
83
84#include <compat/linux/linux_syscallargs.h>
85
860	NOARGS		{ int linux_sys_nosys(void); } syscall
871	NOARGS		{ int sys_exit(int rval); }
882	NOARGS		{ int sys_fork(void); }
893	NOARGS		{ int sys_read(int fd, char *buf, u_int nbyte); }
904	NOARGS		{ int sys_write(int fd, char *buf, u_int nbyte); }
915	STD		{ int linux_sys_open(const char *path, int flags, \
92			    int mode); }
936	NOARGS		{ int sys_close(int fd); }
947	STD		{ int linux_sys_waitpid(int pid, int *status, \
95			    int options);}
968	STD		{ int linux_sys_creat(const char *path, int mode); }
979	STD		{ int linux_sys_link(const char *path, const \
98			    char *link); }
9910	STD		{ int linux_sys_unlink(const char *path); }
10011	STD		{ int linux_sys_execve(const char *path, char **argp, \
101			    char **envp); }
10212	STD		{ int linux_sys_chdir(const char *path); }
10313	STD		{ int linux_sys_time(linux_time_t *t); }
10414	STD		{ int linux_sys_mknod(const char *path, int mode, \
105			    int dev); }
10615	STD		{ int linux_sys_chmod(const char *path, int mode); }
10716	STD		{ int linux_sys_lchown(const char *path, int uid, \
108			    int gid); }
10917	OBSOL		break
11018	OBSOL		ostat
11119	NOARGS		{ long compat_43_sys_lseek(int fd, long offset, \
112			    int whence); }
11320	NOARGS MPSAFE	{ pid_t sys_getpid(void); }
11421	UNIMPL		mount
11522	OBSOL		umount
11623	NOARGS		{ int sys_setuid(uid_t uid); }
11724	NOARGS		{ uid_t sys_getuid(void); }
11825	STD		{ int linux_sys_stime(linux_time_t *t); }
11926	STD		{ int linux_sys_ptrace(int request, int pid, \
120			    int addr, int data); }
12127	STD		{ int linux_sys_alarm(unsigned int secs); }
12228	OBSOL		ofstat
12329	STD		{ int linux_sys_pause(void); }
12430	STD		{ int linux_sys_utime(const char *path, \
125			    struct linux_utimbuf *times); }
12631	OBSOL		stty
12732	OBSOL		gtty
12833	STD		{ int linux_sys_access(const char *path, int flags); }
12934	STD		{ int linux_sys_nice(int incr); }
13035	OBSOL		ftime
13136	NOARGS		{ int sys_sync(void); }
13237	STD		{ int linux_sys_kill(int pid, int signum); }
13338	STD		{ int linux_sys_rename(const char *from, \
134			    const char *to); }
13539	STD		{ int linux_sys_mkdir(const char *path, int mode); }
13640	STD		{ int linux_sys_rmdir(const char *path); }
13741	NOARGS		{ int sys_dup(u_int fd); }
13842	STD		{ int linux_sys_pipe(int *pfds); }
13943	STD		{ int linux_sys_times(struct times *tms); }
14044	OBSOL		prof
14145	STD		{ int linux_sys_brk(char *nsize); }
14246	NOARGS		{ int sys_setgid(gid_t gid); }
14347	NOARGS		{ gid_t sys_getgid(void); }
14448	STD		{ int linux_sys_signal(int signum, \
145			    linux_handler_t handler); }
14649	NOARGS		{ uid_t sys_geteuid(void); }
14750	NOARGS		{ gid_t sys_getegid(void); }
14851	NOARGS		{ int sys_acct(char *path); }
14952	UNIMPL		umount
15053	OBSOL		lock
15154	STD		{ int linux_sys_ioctl(int fd, u_long com, \
152			    caddr_t data); }
15355	STD		{ int linux_sys_fcntl(int fd, int cmd, void *arg); }
15456	OBSOL		mpx
15557	NOARGS		{ int sys_setpgid(int pid, int pgid); }
15658	OBSOL		ulimit
15759 	STD		{ int linux_sys_olduname(struct linux_old_utsname \
158			   *up); }
15960	NOARGS		{ int sys_umask(int newmask); }
16061	NOARGS		{ int sys_chroot(char *path); }
16162	UNIMPL		ustat
16263	NOARGS		{ int sys_dup2(u_int from, u_int to); }
16364	NOARGS		{ pid_t sys_getppid(void); }
16465	NOARGS		{ int sys_getpgrp(void); }
16566	NOARGS		{ int sys_setsid(void); }
16667	STD		{ int linux_sys_sigaction(int signum, \
167			    const struct linux_old_sigaction *nsa, \
168			    struct linux_old_sigaction *osa); }
16968	STD		{ int linux_sys_siggetmask(void); }
17069	STD		{ int linux_sys_sigsetmask(linux_old_sigset_t mask); }
17170	NOARGS		{ int sys_setreuid(uid_t ruid, uid_t euid); }
17271	NOARGS		{ int sys_setregid(gid_t rgid, gid_t egid); }
17372	STD		{ int linux_sys_sigsuspend(caddr_t restart, \
174			    int oldmask, int mask); }
17573	STD		{ int linux_sys_sigpending(linux_old_sigset_t *set); }
17674	NOARGS		{ int compat_43_sys_sethostname(char *hostname, \
177			    u_int len);}
17875	STD		{ int linux_sys_setrlimit(u_int which, \
179			    struct orlimit *rlp); }
18076	STD		{ int linux_sys_getrlimit(u_int which, \
181			    struct orlimit *rlp); }
18277	NOARGS		{ int sys_getrusage(int who, struct rusage *rusage); }
18378	STD		{ int linux_sys_gettimeofday(struct timeval *tp, \
184			    struct timezone *tzp); }
18579	STD		{ int linux_sys_settimeofday(struct timeval *tp, \
186			    struct timezone *tzp); }
18780	NOARGS		{ int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
18881	NOARGS		{ int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
18982	STD		{ int linux_sys_select(int nfds, fd_set* readfds, \
190					fd_set* writefds, fd_set* exceptfds, \
191					struct timeval *timeout); }
19283	STD		{ int linux_sys_symlink(const char *path, \
193			    const char *to); }
19484	NOARGS		{ int compat_43_sys_lstat(const char *path, \
195			    struct stat43 *up); } oolstat
19685	STD		{ int linux_sys_readlink(const char *name, char *buf, \
197			    int count); }
198#ifdef EXEC_AOUT
19986	STD		{ int linux_sys_uselib(const char *path); }
200#else
20186	UNIMPL		sys_uselib
202#endif
20387	STD		{ int linux_sys_swapon(char *name); }
20488	STD		{ int linux_sys_reboot(int magic1, int magic2, \
205			    int cmd, void *arg); }
20689	STD		{ int linux_sys_readdir(int fd, caddr_t dent, \
207			    unsigned int count); }
20890	NOARGS		{ int linux_sys_mmap(unsigned long addr, size_t len, \
209			    int prot, int flags, int fd, linux_off_t offset); }
21091	NOARGS		{ int sys_munmap(caddr_t addr, int len); }
21192	STD		{ int linux_sys_truncate(const char *path, \
212			    long length); }
21393	NOARGS		{ int compat_43_sys_ftruncate(int fd, long length); }
21494	NOARGS		{ int sys_fchmod(int fd, int mode); }
21595	NOARGS		{ int sys___posix_fchown(int fd, int uid, int gid); }
21696	NOARGS		{ int sys_getpriority(int which, int who); }
21797	NOARGS		{ int sys_setpriority(int which, int who, int prio); }
21898	NOARGS		{ int sys_profil(caddr_t samples, u_int size, \
219			    u_int offset, u_int scale); }
22099	STD		{ int linux_sys_statfs(const char *path, \
221			    struct linux_statfs *sp); }
222100	STD		{ int linux_sys_fstatfs(int fd, \
223			    struct linux_statfs *sp); }
224101	STD		{ int linux_sys_ioperm(unsigned int lo, \
225			    unsigned int hi, int val); }
226102	STD		{ int linux_sys_socketcall(int what, void *args); }
227103	UNIMPL		syslog
228104	NOARGS		{ int sys_setitimer(u_int which, \
229			    struct itimerval *itv, struct itimerval *oitv); }
230105	NOARGS		{ int sys_getitimer(u_int which, \
231			    struct itimerval *itv); }
232106	STD		{ int linux_sys_stat(const char *path, \
233			    struct linux_stat *sp); }
234107	STD		{ int linux_sys_lstat(const char *path, \
235			    struct linux_stat *sp); }
236108	STD		{ int linux_sys_fstat(int fd, struct linux_stat *sp); }
237109	STD		{ int linux_sys_uname(struct linux_utsname *up); }
238110	UNIMPL		iopl
239111	UNIMPL		vhangup
240112	UNIMPL		idle
241113	UNIMPL		vm86old
242114	STD		{ int linux_sys_wait4(int pid, int *status, \
243			    int options, struct rusage *rusage); }
244115	STD		{ int linux_sys_swapoff(const char *path); }
245116	STD		{ int linux_sys_sysinfo(struct linux_sysinfo *arg); }
246117	STD		{ int linux_sys_ipc(int what, int a1, int a2, int a3, \
247			    caddr_t ptr); }
248118	NOARGS		{ int sys_fsync(int fd); }
249119	STD		{ int linux_sys_sigreturn(struct linux_sigcontext *scp); }
250120	STD		{ int linux_sys_clone(int flags, void *stack); }
251121	STD		{ int linux_sys_setdomainname(char *domainname, \
252			    int len); }
253122	STD		{ int linux_sys_new_uname(struct linux_utsname *up); }
254123	UNIMPL		modify_ldt
255124	UNIMPL		adjtimex
256125	STD		{ int linux_sys_mprotect(const void *start, \
257			    unsigned long len, int prot); }
258126	STD		{ int linux_sys_sigprocmask(int how, \
259			    const linux_old_sigset_t *set, \
260			    linux_old_sigset_t *oset); }
261127	UNIMPL		create_module
262128	UNIMPL		init_module
263129	UNIMPL		delete_module
264130	UNIMPL		get_kernel_syms
265131	UNIMPL		quotactl
266132	STD		{ int linux_sys_getpgid(int pid); }
267133	NOARGS		{ int sys_fchdir(int fd); }
268134	UNIMPL		bdflush
269135	UNIMPL		sysfs
270136	STD		{ int linux_sys_personality(int per); }
271137	UNIMPL		afs_syscall
272138	STD		{ int linux_sys_setfsuid(uid_t uid); }
273139	NOARGS		{ int linux_sys_getfsuid(void); }
274140	STD		{ int linux_sys_llseek(int fd, u_int32_t ohigh, \
275			    u_int32_t olow, caddr_t res, int whence); }
276141	STD		{ int linux_sys_getdents(int fd, \
277			    struct linux_dirent *dent, unsigned int count); }
278142	STD		{ int linux_sys_new_select(int nfds, fd_set *readfds, \
279			    fd_set *writefds, fd_set *exceptfds, \
280			    struct timeval *timeout); }
281143	NOARGS		{ int sys_flock(int fd, int how); }
282144	STD		{ int linux_sys_msync(caddr_t addr, int len, int fl); }
283145	NOARGS		{ int sys_readv(int fd, struct iovec *iovp, \
284				u_int iovcnt); }
285146	NOARGS		{ int sys_writev(int fd, struct iovec *iovp, \
286				u_int iovcnt); }
287147	NOARGS		{ pid_t sys_getsid(pid_t pid); }
288148	STD		{ int linux_sys_fdatasync(int fd); }
289149	STD		{ int linux_sys___sysctl(struct linux___sysctl *lsp); }
290150	NOARGS		{ int sys_mlock(caddr_t addr, size_t len); }
291151	NOARGS		{ int sys_munlock(caddr_t addr, size_t len); }
292152	NOARGS		{ int sys_mlockall(int flags); }
293153	NOARGS		{ int sys_munlockall(void); }
294154	STD		{ int linux_sys_sched_setparam(pid_t pid, \
295			    const struct linux_sched_param *sp); }
296155	STD		{ int linux_sys_sched_getparam(pid_t pid, \
297			    struct linux_sched_param *sp); }
298156	STD		{ int linux_sys_sched_setscheduler(pid_t pid, \
299			    int policy, const struct linux_sched_param *sp); }
300157	STD		{ int linux_sys_sched_getscheduler(pid_t pid); }
301158	STD		{ int linux_sys_sched_yield(void); }
302159	STD		{ int linux_sys_sched_get_priority_max(int policy); }
303160	STD		{ int linux_sys_sched_get_priority_min(int policy); }
304161	UNIMPL		sched_rr_get_interval
305162	NOARGS		{ int sys_nanosleep(const struct timespec *rqtp, \
306				struct timespec *rmtp); }
307163	STD		{ void *linux_sys_mremap(void *old_address, \
308			    size_t old_size, size_t new_size, u_long flags); }
309164	STD		{ int linux_sys_setresuid(uid_t ruid, uid_t euid, \
310			    uid_t suid); }
311165	STD		{ int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \
312			    uid_t *suid); }
313166	UNIMPL		query_module
314167	NOARGS		{ int sys_poll(struct pollfd *fds, u_int nfds, \
315			    int timeout); }
316168	UNIMPL		nfsservctl
317169	STD		{ int linux_sys_setresgid(gid_t rgid, gid_t egid, \
318			    gid_t sgid); }
319170	STD		{ int linux_sys_getresgid(gid_t *rgid, gid_t *egid, \
320			    gid_t *sgid); }
321171	UNIMPL		prctl
322172	STD		{ int linux_sys_rt_sigreturn( \
323			    struct linux_rt_sigframe *sfp); }
324173	STD		{ int linux_sys_rt_sigaction(int signum, \
325			    const struct linux_sigaction *nsa, \
326			    struct linux_sigaction *osa, \
327			    size_t sigsetsize); }
328174	STD		{ int linux_sys_rt_sigprocmask(int how, \
329			    const linux_sigset_t *set, \
330			    linux_sigset_t *oset, \
331			    size_t sigsetsize); }
332175	STD		{ int linux_sys_rt_sigpending( \
333			    linux_sigset_t *set, \
334			    size_t sigsetsize); }
335176	UNIMPL		rt_sigtimedwait
336; XXX XAX int here?  sigset_t here?  siginfo_t
337177	STD		{ int linux_sys_rt_queueinfo(int pid, int signum, \
338			    void *uinfo); }
339178	STD		{ int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
340			    size_t sigsetsize); }
341179	STD		{ int linux_sys_pread(int fd, char *buf, \
342			    size_t nbyte, linux_off_t offset); }
343180	STD		{ int linux_sys_pwrite(int fd, char *buf, \
344			    size_t nbyte, linux_off_t offset); }
345181	STD		{ int linux_sys_chown(const char *path, \
346			    int uid, int gid); }
347182	NOARGS		{ int sys___getcwd(char *bufp, size_t length); }
348183	UNIMPL		capget
349184	UNIMPL		capset
350185	STD		{ int linux_sys_sigaltstack( \
351			    const struct linux_sigaltstack *ss, \
352			    struct linux_sigaltstack *oss); }
353186	UNIMPL		sendfile
354187	UNIMPL		getpmsg
355188	UNIMPL		putpmsg
356189	NOARGS		{ int sys___vfork14(void); }
357190	STD		{ int linux_sys_ugetrlimit(int which, \
358			    struct rlimit *rlp); }
359191	UNIMPL		/* unused */
360192	NOARGS		{ linux_off_t linux_sys_mmap2(unsigned long addr, \
361			    size_t len, int prot, int flags, int fd, \
362			    linux_off_t offset); }
363193	STD		{ int linux_sys_truncate64(const char *path, \
364			    off_t length); }
365194	STD		{ int linux_sys_ftruncate64(unsigned int fd, \
366			    off_t length); }
367195	STD		{ int linux_sys_stat64(const char *path, \
368			    struct linux_stat64 *sp); }
369196	STD		{ int linux_sys_lstat64(const char *path, \
370			    struct linux_stat64 *sp); }
371197	STD		{ int linux_sys_fstat64(int fd, \
372			    struct linux_stat64 *sp); }
373198	UNIMPL		sys_pciconfig_read
374199	UNIMPL		sys_pciconfig_write
375200	UNIMPL		sys_pciconfig_iobase
376201	UNIMPL		/* Unused (MacOnLinux project) */
377202	STD		{ int linux_sys_getdents64(int fd, \
378			    struct linux_dirent64 *dent, unsigned int count); }
379203	UNIMPL		pivot_root
380204	STD		{ int linux_sys_fcntl64(int fd, int cmd, void *arg); }
381205	NOARGS		{ int sys_mincore(void *addr, size_t len, char *vec); }
382206	NOARGS		{ int sys_madvise(void *addr, size_t len, int behav); }
383207	UNIMPL		gettid
384208	UNIMPL		tkill
385209	STD		{ int linux_sys_setxattr(char *path, char *name, \
386			    void *value, size_t size, int flags); }
387210	STD		{ int linux_sys_lsetxattr(char *path, char *name, \
388			    void *value, size_t size, int flags); }
389211	STD		{ int linux_sys_fsetxattr(int fd, char *name, \
390			    void *value, size_t size, int flags); }
391212	STD		{ ssize_t linux_sys_getxattr(char *path, char *name, \
392			    void *value, size_t size); }
393213	STD		{ ssize_t linux_sys_lgetxattr(char *path, char *name, \
394			    void *value, size_t size); }
395214	STD		{ ssize_t linux_sys_fgetxattr(int fd, char *name, \
396			    void *value, size_t size); }
397215	STD		{ ssize_t linux_sys_listxattr(char *path, char *list, \
398			    size_t size); }
399216	STD		{ ssize_t linux_sys_llistxattr(char *path, char *list, \
400			    size_t size); }
401217	STD		{ ssize_t linux_sys_flistxattr(int fd, char *list, \
402			    size_t size); }
403218	STD		{ int linux_sys_removexattr(char *path, char *name); }
404219	STD		{ int linux_sys_lremovexattr(char *path, char *name); }
405220	STD		{ int linux_sys_fremovexattr(int fd, char *name); }
406221	UNIMPL		futex
407222	UNIMPL		sched_setaffinity
408223	UNIMPL		sched_getaffinity
409224	UNIMPL		/* unused */
410225	UNIMPL		tuxcall
411226	UNIMPL		sendfile64
412227	UNIMPL		io_setup
413228	UNIMPL		io_destroy
414229	UNIMPL		io_getevents
415230	UNIMPL		io_submit
416231	UNIMPL		io_cancel
417232	UNIMPL		set_tid_address
418233	UNIMPL		fadvise64
419234	STD		{ int linux_sys_exit_group(int error_code); }
420235	UNIMPL		lookup_dcookie
421236	UNIMPL		epoll_create
422237	UNIMPL		epoll_ctl
423238	UNIMPL		epoll_wait
424239	UNIMPL		remap_file_pages
425240	UNIMPL		timer_create
426241	UNIMPL		timer_settime
427242	UNIMPL		timer_gettime
428243	UNIMPL		timer_getoverrun
429244	UNIMPL		timer_delete
430245	STD		{ int linux_sys_clock_settime(clockid_t which, \
431			    struct linux_timespec *tp); }
432246	STD		{ int linux_sys_clock_gettime(clockid_t which, \
433			    struct linux_timespec *tp); }
434247	STD		{ int linux_sys_clock_getres(clockid_t which, \
435			    struct linux_timespec *tp); }
436248	STD		{ int linux_sys_clock_nanosleep(clockid_t which, \
437			    int flags, struct linux_timespec *rqtp, \
438			    struct linux_timespec *rmtp); }
439249	UNIMPL		swapcontext
440250	UNIMPL		tgkill
441251	UNIMPL		utimes
442252	STD		{ int linux_sys_statfs64(const char *path, \
443			    size_t sz, struct linux_statfs64 *sp); }
444253	STD		{ int linux_sys_fstatfs64(int fd, \
445			    size_t sz, struct linux_statfs64 *sp); }
446254	UNIMPL		fadvise64_64
447255	UNIMPL		rtas
448256	UNIMPL		/* reserved for sys_debug_setcontext */
449257	UNIMPL		/* reserved for vserver */
450258	UNIMPL		/* reserved for new sys_remap_file_pages */
451259	UNIMPL		/* reserved for new sys_mbind */
452260	UNIMPL		/* reserved for new sys_get_mempolicy */
453261	UNIMPL		/* reserved for new sys_set_mempolicy */
454262	UNIMPL		mq_open
455263	UNIMPL		mq_unlink
456264	UNIMPL		mq_timedsend
457265	UNIMPL		mq_timedreceive
458266	UNIMPL		mq_notify
459267	UNIMPL		mq_getsetattr
460268	UNIMPL		kexec_load
461