1 $NetBSD: syscalls.master,v 1.70 2009/06/17 14:18:51 njoly Exp $
3 ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
5 ; NetBSD alpha COMPAT_LINUX system call name/number "master" file.
6 ; (See syscalls.conf to see what it is processed into.)
8 ; Fields: number type [type-dependent ...]
9 ; number system call number, must be in order
10 ; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
11 ; the compatibility options defined in syscalls.conf.
15 ; OBSOL obsolete, not included in system
16 ; UNIMPL unimplemented, not included in system
17 ; NODEF included, but don't define the syscall number
18 ; NOARGS included, but don't define the syscall args structure
19 ; INDIR included, but don't define the syscall args structure
20 ; and allow it to be "really" varargs.
22 ; The compat options are defined in the syscalls.conf file, and the
23 ; compat option name is prefixed to the syscall name. Other than
24 ; that, they're like NODEF (for 'compat' options), or STD (for
25 ; 'libcompat' options).
27 ; The type-dependent arguments are as follows:
28 ; For STD, NODEF, NOARGS, and compat syscalls:
29 ; { pseudo-proto } [alias]
33 ; #ifdef's, etc. may be included, and are copied to the output files.
34 ; #include's are copied to the syscall names and switch definition files only.
38 ; XXX XAX things to do:
39 ; make sure non-linux_foo() matches real linux syscalls.
40 ; create new linux_foo functions otherwise
41 ; (i.e. reboot, msgrcv? )
42 ; make sure linux_foo() matches expected prototypes in .c files.
43 ; kill not used functions. (ifdef the actual code)
44 ; make linux_sys_sigreturn in linux_machdep.c use frame.extramask
46 ; NOT USED = This syscall is not really used in Linux, except in its
47 ; osf compat mode. Since Linux binaries shouldn't ever
48 ; call it and osf binaries run under a different emulation,
49 ; it shouldn't matter that the linux version of the
50 ; function might not DTRT. Define it anyway so we
51 ; don't have to split off or ifdef the associated function.
52 ; A bit better might be to have makesyscalls identify this
53 ; as "define but don't include in table" so it doesn't actually
55 ; UNIMPL <blank> = not implemented here nor in linux source
56 ; UNIMPL osf_* = osf functions implemented in linux, not here.
59 #if defined(_KERNEL_OPT)
63 #include <sys/param.h>
65 #include <sys/systm.h>
66 #include <sys/signal.h>
67 #include <sys/mount.h>
68 #include <sys/syscallargs.h>
70 #include <compat/linux/common/linux_types.h>
71 #include <compat/linux/common/linux_signal.h>
72 #include <compat/linux/common/linux_siginfo.h>
73 #include <compat/linux/common/linux_ipc.h>
74 #include <compat/linux/common/linux_msg.h>
75 #include <compat/linux/common/linux_sem.h>
76 #include <compat/linux/common/linux_shm.h>
77 #include <compat/linux/common/linux_mmap.h>
78 ;#include <compat/linux/common/linux_machdep.h>
80 #include <compat/linux/linux_syscallargs.h>
84 0 NOARGS { int|linux_sys||nosys(void); } syscall
85 1 NOARGS { int|sys||exit(int rval); }
86 2 NOARGS { int|sys||fork(void); }
87 3 NOARGS { int|sys||read(int fd, void *buf, size_t nbyte); }
88 4 NOARGS { int|sys||write(int fd, const void *buf, size_t nbyte); }
90 6 NOARGS { int|sys||close(int fd); }
91 7 NODEF { int|osf1_sys||wait4(int pid, int *status, \
92 int options, struct osf1_rusage *rusage); }
93 ;8 ALIAS osf1_sys_old_creat, NOT USED
94 8 STD { int|linux_sys||creat(const char *path, mode_t mode); }
95 9 NOARGS { int|sys||link(const char *path, const char *link); }
96 10 STD { int|linux_sys||unlink(const char *path); }
98 12 NOARGS { int|sys||chdir(const char *path); }
99 13 NOARGS { int|sys||fchdir(int fd); }
100 14 STD { int|linux_sys||mknod(const char *path, int mode, int dev); }
101 15 NOARGS { int|sys||chmod(const char *path, int mode); }
102 16 NOARGS { int|sys||__posix_chown(const char *path, int uid, int gid); }
103 ;17 ALIAS osf1_sys_brk
104 17 STD { int|linux_sys||brk(char *nsize); }
106 19 NOARGS { long|compat_43_sys||lseek(int fd, long offset, \
108 20 NOARGS { pid_t|sys||getpid_with_ppid(void); }
109 21 NODEF { int|osf1_sys||mount(int type, const char *path, \
110 int flags, void *data); }
112 23 NOARGS { int|sys||setuid(uid_t uid); }
113 24 NOARGS { uid_t|sys||getuid_with_euid(void); }
115 26 STD { int|linux_sys||ptrace(long request, long pid, \
116 long addr, long data); }
123 33 NOARGS { int|sys||access(const char *path, int flags); }
126 36 NOARGS { int|sys||sync(void); }
127 37 STD { int|linux_sys||kill(int pid, int signum); }
129 39 NOARGS { int|sys||setpgid(int pid, int pgid); }
131 41 NOARGS { int|sys||dup(int fd); }
132 42 NOARGS { int|linux_sys||pipe(void); }
133 43 NODEF { int|osf1_sys||set_program_attributes( \
134 void *taddr, unsigned long tsize, \
135 void *daddr, unsigned long dsize); }
137 45 STD { int|linux_sys||open(const char *path, int flags, int mode); }
139 47 NOARGS { gid_t|sys||getgid_with_egid(void); }
140 ; ALIAS osf1_sys_sigprocmask(int how, unsigned long mask);
141 ; XXX <- copied from osf1/syscalls.master
142 48 NOARGS { int|compat_13_sys||sigprocmask(int how, \
146 51 NOARGS { int|sys||acct(const char *path); }
147 52 STD { int|linux_sys||sigpending(linux_old_sigset_t *set); }
149 54 STD { int|linux_sys||ioctl(int fd, u_long com, \
153 57 NOARGS { int|sys||symlink(const char *path, const char *to); }
154 58 NOARGS { int|sys||readlink(const char *name, char *buf, \
156 59 NOARGS { int|sys||execve(const char *path, char **argp, \
158 60 NOARGS { mode_t|sys||umask(mode_t newmask); }
159 61 NOARGS { int|sys||chroot(const char *path); }
161 63 NOARGS { int|sys||getpgrp(void); }
162 64 NOARGS { int|compat_43_sys||getpagesize(void); }
164 66 NOARGS { int|sys|14|vfork(void); }
165 67 STD { int|linux_sys||stat(const char *path, \
166 struct linux_stat *sp); }
167 68 STD { int|linux_sys||lstat(const char *path, \
168 struct linux_stat *sp); }
171 ;71 ALIAS osf1_sys_mmap
172 71 NOARGS { int|linux_sys||mmap(unsigned long addr, size_t len, \
173 int prot, int flags, int fd, linux_off_t offset); }
175 73 NOARGS { int|sys||munmap(void *addr, size_t len); }
176 74 STD { int|linux_sys||mprotect(const void *start, \
177 unsigned long len, int prot); }
178 75 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); }
182 79 NOARGS { int|sys||getgroups(int gidsetsize, gid_t *gidset); }
183 80 NOARGS { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }
186 83 NODEF { int|osf1_sys||setitimer(u_int which, \
187 struct osf1_itimerval *itv, \
188 struct osf1_itimerval *oitv); }
191 86 UNIMPL osf1_sys_getitimer
192 87 NOARGS { int|compat_43_sys||gethostname(char *hostname, \
194 88 NOARGS { int|compat_43_sys||sethostname(char *hostname, \
196 89 UNIMPL getdtablesize
197 90 NOARGS { int|sys||dup2(int from, int to); }
198 91 STD { int|linux_sys||fstat(int fd, struct linux_stat *sp); }
199 92 STD { int|linux_sys||fcntl(int fd, int cmd, void *arg); }
200 93 NODEF { int|osf1_sys||select(u_int nd, fd_set *in, \
201 fd_set *ou, fd_set *ex, struct osf1_timeval *tv); }
202 94 NOARGS { int|sys||poll(struct pollfd *fds, u_int nfds, \
204 95 NOARGS { int|sys||fsync(int fd); }
205 96 NOARGS { int|sys||setpriority(int which, int who, int prio); }
206 97 STD { int|linux_sys||socket(int domain, int type, \
208 98 STD { int|linux_sys||connect(int s, \
209 const struct osockaddr *name, \
210 unsigned int namelen); }
211 99 STD { int|linux_sys||accept(int s, \
212 struct osockaddr *name, int *anamelen); }
213 ;100 ALIAS osf1_sys_getpriority
214 100 STD { int|linux_sys||getpriority(int which, int who); }
215 101 STD { int|linux_sys||send(int s, void *buf, int len, \
217 102 STD { int|linux_sys||recv(int s, void *buf, int len, \
219 103 STD { int|linux_sys||sigreturn(struct linux_sigframe *sfp); }
220 104 STD { int|linux_sys||bind(int s, \
221 const struct osockaddr *name, \
222 unsigned int namelen); }
223 105 STD { int|linux_sys||setsockopt(int s, int level, \
224 int optname, void *optval, int optlen); }
225 106 NOARGS { int|sys||listen(int s, int backlog); }
231 111 STD { int|linux_sys||sigsuspend(void *restart, \
232 int oldmask, int mask); }
233 ;112 ALIAS osf1_sys_sigstack
234 112 NOARGS { int|compat_43_sys||sigstack(struct sigstack *nss, \
235 struct sigstack *oss); }
236 113 STD { ssize_t|linux_sys||recvmsg(int s, \
237 struct linux_msghdr *msg, int flags); }
238 114 STD { ssize_t|linux_sys||sendmsg(int s, \
239 const struct linux_msghdr *msg, int flags); }
241 116 NODEF { int|osf1_sys||gettimeofday(struct osf1_timeval *tv, \
242 struct osf1_timezone *tzp); }
243 117 NODEF { int|osf1_sys||getrusage(int who, \
244 struct osf1_rusage *rusage); }
245 118 STD { int|linux_sys||getsockopt(int s, int level, \
246 int optname, void *optval, int *optlen); }
248 120 NOARGS { ssize_t|sys||readv(int fd, const struct iovec *iovp, \
250 121 NOARGS { ssize_t|sys||writev(int fd, const struct iovec *iovp, \
252 122 NODEF { int|osf1_sys||settimeofday(struct osf1_timeval *tv, \
253 struct osf1_timezone *tzp); }
254 123 NOARGS { int|sys||__posix_fchown(int fd, int uid, int gid); }
255 124 NOARGS { int|sys||fchmod(int fd, mode_t mode); }
256 125 STD { int|linux_sys||recvfrom(int s, void *buf, int len, \
257 int flags, struct osockaddr *from, \
259 126 NOARGS { int|sys||setreuid(uid_t ruid, uid_t euid); }
260 127 NOARGS { int|sys||setregid(gid_t rgid, gid_t egid); }
261 128 NOARGS { int|sys||__posix_rename(const char *from, const char *to); }
262 129 NOARGS { int|compat_43_sys||truncate(const char *path, \
264 130 NOARGS { int|compat_43_sys||ftruncate(int fd, long length); }
265 131 NOARGS { int|sys||flock(int fd, int how); }
266 132 NOARGS { int|sys||setgid(gid_t gid); }
267 133 STD { int|linux_sys||sendto(int s, void *msg, int len, \
268 int flags, struct osockaddr *to, int tolen); }
269 134 NOARGS { int|sys||shutdown(int s, int how); }
270 135 STD { int|linux_sys||socketpair(int domain, int type, \
271 int protocol, int *rsv); }
272 136 NOARGS { int|sys||mkdir(const char *path, int mode); }
273 137 NOARGS { int|sys||rmdir(const char *path); }
274 138 NODEF { int|osf1_sys||utimes(const char *path, \
275 const struct osf1_timeval *tptr); }
278 141 STD { int|linux_sys||getpeername(int fdes, \
279 void *asa, int *alen); }
282 144 STD { int|linux_sys||getrlimit(int which, \
283 struct orlimit *rlp); }
284 145 STD { int|linux_sys||setrlimit(int which, \
285 const struct orlimit *rlp); }
287 147 NOARGS { int|sys||setsid(void); }
290 150 STD { int|linux_sys||getsockname(int fdec, \
291 void *asa, int *alen); }
297 ;156 ALIAS osf1_sys_sigaction
298 156 STD { int|linux_sys||sigaction(int signum, \
299 const struct linux_old_sigaction *nsa, \
300 struct linux_old_sigaction *osa); }
303 ;159 ALIAS osf1_sys_getdirentries
304 159 NOARGS { int|compat_43_sys||getdirentries(int fd, char *buf, \
305 u_int count, long *basep); }
306 160 NODEF { int|osf1_sys||statfs(const char *path, \
307 struct osf1_statfs *buf, int len); }
308 161 NODEF { int|osf1_sys||fstatfs(int fd, \
309 struct osf1_statfs *buf, int len); }
313 ;165 ALIAS osf1_sys_getdomainname
314 165 NOARGS { int|compat_09_sys||getdomainname(char *domainname, \
316 166 STD { int|linux_sys||setdomainname(char *domainname, \
343 191 STD { int|linux_sys||ugetrlimit(int which, \
344 struct rlimit *rlp); }
352 199 UNIMPL osf1_sys_swapon
354 200 NOARGS { int|linux_sys||msgctl(int msqid, int cmd, \
355 struct linux_msqid_ds *buf); }
356 201 NOARGS { int|sys||msgget(key_t key, int msgflg); }
357 202 NOARGS { ssize_t|sys||msgrcv(int msqid, void *msgp, \
358 size_t msgsz, long msgtyp, int msgflg); }
359 203 NOARGS { int|sys||msgsnd(int msqid, void *msgp, size_t msgsz, \
368 204 NOARGS { int|linux_sys||semctl(int semid, int semnum, \
369 int cmd, union linux_semun arg); }
370 205 NOARGS { int|sys||semget(key_t key, int nsems, int semflg); }
371 206 NOARGS { int|sys||semop(int semid, struct sembuf *sops, \
378 ;207 ALIAS osf1_sys_utsname
379 207 STD { int|linux_sys||olduname(struct linux_old_utsname *up); }
380 208 NOARGS { int|sys||__posix_lchown(const char *path, int uid, int gid); }
382 209 NOARGS { int|linux_sys||shmat(int shmid, void *shmaddr, \
383 int shmflg, u_long *raddr); }
384 210 NOARGS { int|linux_sys||shmctl(int shmid, int cmd, \
385 struct linux_shmid_ds *buf); }
386 211 NOARGS { int|sys||shmdt(const void *shmaddr); }
387 212 NOARGS { int|linux_sys||shmget(key_t key, size_t size, int shmflg); }
398 217 NOARGS { int|sys|13|msync(void *addr, size_t len, int flags); }
414 233 NOARGS { pid_t|sys||getpgid(pid_t pid); }
415 234 NOARGS { pid_t|sys||getsid(pid_t pid); }
416 235 UNIMPL sigaltstack
422 241 NODEF { int|osf1_sys||sysinfo(int cmd, char buf, long len); }
425 244 UNIMPL osf1_sys_proplist_syscall
432 251 NODEF { int|osf1_sys||usleep_thread( \
433 struct osf1_timeval *sleep, \
434 struct osf1_timeval *slept); }
439 256 NODEF { int|osf1_sys||getsysinfo(u_long op, void *buffer, \
440 u_long nbytes, void *arg, u_long flag); }
441 257 NODEF { int|osf1_sys||setsysinfo(u_long op, void *buffer, \
442 u_long nbytes, void *arg, u_long flag); }
446 ; This entry doesn't exist in the Alpha linux syscall table but the function is
447 ; implemented and used on other ports.
448 261 STD { int|linux_sys||fdatasync(int fd); }
490 303 UNIMPL old_adjtimex
491 304 STD { int|linux_sys||swapoff(const char *path); }
492 305 STD { int|linux_sys||getdents(int fd, \
493 struct linux_dirent *dent, unsigned int count); }
494 306 UNIMPL alpha_create_module
495 307 UNIMPL init_module
496 308 UNIMPL delete_module
497 309 UNIMPL get_kernel_syms
499 311 STD { int|linux_sys||reboot(int magic1, int magic2, \
500 int cmd, void *arg); }
501 312 STD { int|linux_sys||clone(int flags, void *stack); }
503 313 STD { int|linux_sys||uselib(const char *path); }
505 313 UNIMPL sys_uselib
507 314 NOARGS { int|sys||mlock(const void *addr, size_t len); }
508 315 NOARGS { int|sys||munlock(const void *addr, size_t len); }
509 316 NOARGS { int|sys||mlockall(int flags); }
510 317 NOARGS { int|sys||munlockall(void); }
511 318 STD { int|linux_sys||sysinfo(struct linux_sysinfo *arg); }
512 319 STD { int|linux_sys||__sysctl(struct linux___sysctl *lsp); }
515 322 STD { int|linux_sys||swapon(const char *name); }
516 323 STD { int|linux_sys||times(struct times *tms); }
517 324 STD { int|linux_sys||personality(unsigned long per); }
518 325 STD { int|linux_sys||setfsuid(uid_t uid); }
519 326 STD { int|linux_sys||setfsgid(gid_t gid); }
521 328 STD { int|linux_sys||statfs(const char *path, \
522 struct linux_statfs *sp); }
523 329 STD { int|linux_sys||fstatfs(int fd, \
524 struct linux_statfs *sp); }
525 330 STD { int|linux_sys||sched_setparam(pid_t pid, \
526 const struct linux_sched_param *sp); }
527 331 STD { int|linux_sys||sched_getparam(pid_t pid, \
528 struct linux_sched_param *sp); }
529 332 STD { int|linux_sys||sched_setscheduler(pid_t pid, \
530 int policy, const struct linux_sched_param *sp); }
531 333 STD { int|linux_sys||sched_getscheduler(pid_t pid); }
532 334 STD { int|linux_sys||sched_yield(void); }
533 335 STD { int|linux_sys||sched_get_priority_max(int policy); }
534 336 STD { int|linux_sys||sched_get_priority_min(int policy); }
535 337 UNIMPL sched_rr_get_interval
536 338 UNIMPL afs_syscall
537 339 STD { int|linux_sys||uname(struct linux_utsname *up); }
538 340 STD { int|linux_sys||nanosleep( \
539 const struct linux_timespec *rqtp, \
540 struct linux_timespec *rmtp); }
541 341 STD { void *|linux_sys||mremap(void *old_address, \
542 size_t old_size, size_t new_size, u_long flags); }
543 342 UNIMPL nfsservctl
544 343 STD { int|linux_sys||setresuid(uid_t ruid, uid_t euid, \
546 344 STD { int|linux_sys||getresuid(uid_t *ruid, uid_t *euid, \
548 345 UNIMPL pciconfig_read
549 346 UNIMPL pciconfig_write
550 347 UNIMPL query_module
552 349 STD { int|linux_sys||pread(int fd, char *buf, \
553 size_t nbyte, linux_off_t offset); }
554 350 STD { int|linux_sys||pwrite(int fd, char *buf, \
555 size_t nbyte, linux_off_t offset); }
556 351 STD { int|linux_sys||rt_sigreturn( \
557 struct linux_rt_sigframe *sfp); }
558 352 STD { int|linux_sys||rt_sigaction(int signum, \
559 const struct linux_sigaction *nsa, \
560 struct linux_sigaction *osa, \
561 size_t sigsetsize); }
562 353 STD { int|linux_sys||rt_sigprocmask(int how, \
563 const linux_sigset_t *set, \
564 linux_sigset_t *oset, \
565 size_t sigsetsize); }
566 354 STD { int|linux_sys||rt_sigpending( \
567 linux_sigset_t *set, \
568 size_t sigsetsize); }
569 355 UNIMPL rt_sigtimedwait
570 356 STD { int|linux_sys||rt_queueinfo(int pid, int signum, \
571 linux_siginfo_t *uinfo); }
572 357 STD { int|linux_sys||rt_sigsuspend(linux_sigset_t *unewset, \
573 size_t sigsetsize); }
574 358 STD { int|linux_sys||select(int nfds, fd_set *readfds, \
575 fd_set *writefds, fd_set *exceptfds, \
576 struct timeval50 *timeout); }
577 359 NOARGS { int|compat_50_sys||gettimeofday( \
578 struct timeval50 *tp, struct timezone *tzp); }
579 360 NOARGS { int|compat_50_sys||settimeofday( \
580 const struct timeval50 *tp, \
581 const struct timezone *tzp); }
582 361 NOARGS { int|compat_50_sys||getitimer(int which, \
583 struct itimerval50 *itv); }
584 362 NOARGS { int|compat_50_sys||setitimer(int which, \
585 const struct itimerval50 *itv, \
586 struct itimerval50 *oitv); }
587 363 NOARGS { int|compat_50_sys||utimes(char *path, \
588 struct timeval50 *times); }
589 364 NOARGS { int|compat_50_sys||getrusage(int who, \
590 struct rusage50 *rusage); }
591 365 STD { int|linux_sys||wait4(int pid, int *status, \
592 int options, struct rusage50 *rusage); }
594 367 NOARGS { int|sys||__getcwd(char *bufp, size_t length); }
601 374 UNIMPL pivot_root
602 375 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); }
603 376 UNIMPL pciconfig_iobase
604 377 STD { int|linux_sys||getdents64(int fd, \
605 struct linux_dirent64 *dent, unsigned int count); }
608 380 UNIMPL /* unused */
610 382 STD { int|linux_sys||setxattr(char *path, char *name, \
611 void *value, size_t size, int flags); }
612 383 STD { int|linux_sys||lsetxattr(char *path, char *name, \
613 void *value, size_t size, int flags); }
614 384 STD { int|linux_sys||fsetxattr(int fd, char *name, \
615 void *value, size_t size, int flags); }
616 385 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \
617 void *value, size_t size); }
618 386 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \
619 void *value, size_t size); }
620 387 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \
621 void *value, size_t size); }
622 388 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \
624 389 STD { ssize_t|linux_sys||llistxattr(char *path, char *list, \
626 390 STD { ssize_t|linux_sys||flistxattr(int fd, char *list, \
628 391 STD { int|linux_sys||removexattr(char *path, char *name); }
629 392 STD { int|linux_sys||lremovexattr(char *path, char *name); }
630 393 STD { int|linux_sys||fremovexattr(int fd, char *name); }
632 395 UNIMPL sched_setaffinity
633 396 UNIMPL sched_getaffinity
636 399 UNIMPL io_destroy
637 400 UNIMPL io_getevents
640 403 UNIMPL /* unused */
641 404 UNIMPL /* unused */
642 405 STD { int|linux_sys||exit_group(int error_code); }
643 406 UNIMPL lookup_dcookie
644 407 UNIMPL sys_epoll_create
645 408 UNIMPL sys_epoll_ctl
646 409 UNIMPL sys_epoll_wait
647 410 UNIMPL remap_file_pages
648 411 UNIMPL set_tid_address
649 412 UNIMPL restart_syscall
651 414 UNIMPL timer_create
652 415 UNIMPL timer_settime
653 416 UNIMPL timer_gettime
654 417 UNIMPL timer_getoverrun
655 418 UNIMPL timer_delete
656 419 STD { int|linux_sys||clock_settime(clockid_t which, \
657 struct linux_timespec *tp); }
658 420 STD { int|linux_sys||clock_gettime(clockid_t which, \
659 struct linux_timespec *tp); }
660 421 STD { int|linux_sys||clock_getres(clockid_t which, \
661 struct linux_timespec *tp); }
662 422 STD { int|linux_sys||clock_nanosleep(clockid_t which, \
663 int flags, struct linux_timespec *rqtp, \
664 struct linux_timespec *rmtp); }
665 423 UNIMPL semtimedop
672 430 UNIMPL get_mempolicy
673 431 UNIMPL set_mempolicy
676 434 UNIMPL mq_timedsend
677 435 UNIMPL mq_timedreceive
679 437 UNIMPL mq_getsetattr