syscalls.master revision 1.27 1 $NetBSD: syscalls.master,v 1.27 2009/01/11 02:45:48 christos Exp $
2
3 ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
4
5 ; NetBSD amd64 COMPAT_LINUX system call name/number "master" file.
6 ; (See syscalls.conf to see what it is processed into.)
7 ;
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.
12 ;
13 ; types:
14 ; STD always included
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.
21 ;
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).
26 ;
27 ; The type-dependent arguments are as follows:
28 ; For STD, NODEF, NOARGS, and compat syscalls:
29 ; { pseudo-proto } [alias]
30 ; For other syscalls:
31 ; [comment]
32 ;
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.
35
36 #if defined(_KERNEL_OPT)
37 #include "opt_sysv.h"
38 #include "opt_compat_43.h"
39 #include "opt_compat_netbsd.h"
40 #endif
41
42
43 #include <sys/param.h>
44 #include <sys/poll.h>
45 #include <sys/systm.h>
46 #include <sys/signal.h>
47 #include <sys/mount.h>
48 #include <sys/syscallargs.h>
49 #include <sys/time.h>
50
51 #include <compat/sys/time.h>
52
53 #include <compat/linux/common/linux_types.h>
54 #include <compat/linux/common/linux_mmap.h>
55 #include <compat/linux/common/linux_ipc.h>
56 #include <compat/linux/common/linux_msg.h>
57 #include <compat/linux/common/linux_sem.h>
58 #include <compat/linux/common/linux_shm.h>
59 #include <compat/linux/common/linux_signal.h>
60 #include <compat/linux/common/linux_siginfo.h>
61 #include <compat/linux/common/linux_machdep.h>
62
63 #include <compat/linux/linux_syscallargs.h>
64
65 %%
66
67 0 NOARGS { int sys_read(int fd, char *buf, u_int nbyte); }
68 1 NOARGS { int sys_write(int fd, char *buf, u_int nbyte); }
69 2 STD { int linux_sys_open(const char *path, int flags, \
70 int mode); }
71 3 NOARGS { int sys_close(int fd); }
72 4 STD { int linux_sys_stat64(const char *path, \
73 struct linux_stat *sp); }
74 5 STD { int linux_sys_fstat64(int fd, \
75 struct linux_stat *sp); }
76 6 STD { int linux_sys_lstat64(const char *path, \
77 struct linux_stat *sp); }
78 7 NOARGS { int sys_poll(struct pollfd *fds, u_int nfds, \
79 int timeout); }
80 8 NOARGS { long compat_43_sys_lseek(int fd, long offset, \
81 int whence); }
82 9 NOARGS { linux_off_t linux_sys_mmap(unsigned long addr, \
83 size_t len, int prot, int flags, int fd, \
84 linux_off_t offset); }
85 10 STD { int linux_sys_mprotect(const void *start, \
86 unsigned long len, int prot); }
87 11 NOARGS { int sys_munmap(void *addr, int len); }
88 12 STD { int linux_sys_brk(char *nsize); }
89 13 STD { int linux_sys_rt_sigaction(int signum, \
90 const struct linux_sigaction *nsa, \
91 struct linux_sigaction *osa, \
92 size_t sigsetsize); }
93 14 STD { int linux_sys_rt_sigprocmask(int how, \
94 const linux_sigset_t *set, \
95 linux_sigset_t *oset, \
96 size_t sigsetsize); }
97 15 NOARGS { int linux_sys_rt_sigreturn(void); }
98 16 STD { int linux_sys_ioctl(int fd, u_long com, \
99 void *data); }
100 17 STD { int linux_sys_pread(int fd, char *buf, \
101 size_t nbyte, linux_off_t offset); }
102 18 STD { int linux_sys_pwrite(int fd, char *buf, \
103 size_t nbyte, linux_off_t offset); }
104 19 NOARGS { int sys_readv(int fd, struct iovec *iovp, \
105 u_int iovcnt); }
106 20 NOARGS { int sys_writev(int fd, struct iovec *iovp, \
107 u_int iovcnt); }
108 21 NOARGS { int sys_access(const char *path, int flags); }
109 22 STD { int linux_sys_pipe(int *pfds); }
110 23 STD { int linux_sys_select(int nfds, fd_set *readfds, \
111 fd_set *writefds, fd_set *exceptfds, \
112 struct timeval *timeout); }
113 24 STD { int linux_sys_sched_yield(void); }
114 25 STD { void *linux_sys_mremap(void *old_address, \
115 size_t old_size, size_t new_size, u_long flags); }
116 26 NOARGS { int sys___msync13(void *addr, size_t len, int flags); }
117 27 NOARGS { int sys_mincore(void *addr, size_t len, char *vec); }
118 28 NOARGS { int sys_madvise(void *addr, size_t len, int behav); }
119 #ifdef SYSVSHM
120 29 NOARGS { int linux_sys_shmget(key_t key, size_t size, \
121 int shmflg); }
122 30 NOARGS { int sys_shmat(int shmid, void *shmaddr, int shmflg); }
123 31 NOARGS { int linux_sys_shmctl(int shmid, int cmd, \
124 struct linux_shmid_ds *buf); }
125 #else
126 29 UNIMPL shmget
127 30 UNIMPL shmat
128 31 UNIMPL shmctl
129 #endif
130 32 NOARGS { int sys_dup(u_int fd); }
131 33 NOARGS { int sys_dup2(u_int from, u_int to); }
132 34 STD { int linux_sys_pause(void); }
133 35 STD { int linux_sys_nanosleep( \
134 const struct linux_timespec *rqtp, \
135 struct linux_timespec *rmtp); }
136 36 NOARGS { int compat_50_sys_getitimer(u_int which, \
137 struct itimerval50 *itv); }
138 37 STD { int linux_sys_alarm(unsigned int secs); }
139 38 NOARGS { int compat_50_sys_setitimer(u_int which, \
140 struct itimerval50 *itv, \
141 struct itimerval50 *oitv); }
142 39 STD { pid_t linux_sys_getpid(void); }
143 40 UNIMPL sendfile
144 41 STD { int linux_sys_socket(int domain, \
145 int type, int protocol); }
146 42 STD { int linux_sys_connect(int s, \
147 const struct osockaddr *name, \
148 unsigned int namelen); }
149 43 STD { int linux_sys_accept(int s, struct osockaddr *name, \
150 int *anamelen); } oaccept
151 44 STD { ssize_t linux_sys_sendto(int s, void *msg, int len, \
152 int flags, struct osockaddr *to, int tolen); }
153 45 STD { ssize_t linux_sys_recvfrom(int s, void *buf, \
154 size_t len, int flags, struct osockaddr *from, \
155 unsigned int *fromlenaddr); }
156 46 STD { int linux_sys_sendmsg(int s, \
157 const struct msghdr *msg, int flags); }
158 47 STD { ssize_t linux_sys_recvmsg(int s, \
159 struct msghdr *msg, int flags); }
160 48 NOARGS { int sys_shutdown(int s, int how); }
161 49 STD { int linux_sys_bind(int s, \
162 const struct osockaddr *name, \
163 unsigned int namelen); }
164 50 NOARGS { int sys_listen(int s, int backlog); }
165 51 STD { int linux_sys_getsockname(int fdec, void *asa, \
166 int *alen); }
167 52 STD { int linux_sys_getpeername(int fdes, \
168 struct sockaddr *asa, unsigned int *alen); }
169 53 STD { int linux_sys_socketpair(int domain, int type, \
170 int protocol, int *rsv); }
171 54 STD { int linux_sys_setsockopt(int s, int level, \
172 int optname, void *optval, int optlen); }
173 55 STD { int linux_sys_getsockopt(int s, int level, \
174 int optname, void *optval, int *optlen); }
175 56 STD { int linux_sys_clone(int flags, void *stack, \
176 void *parent_tidptr, void *child_tidptr); }
177 57 NOARGS { int sys_fork(void); }
178 58 NOARGS { int sys___vfork14(void); }
179 59 NOARGS { int sys_execve(const char *path, char **argp, \
180 char **envp); }
181 60 NOARGS { int sys_exit(int rval); }
182 61 STD { int linux_sys_wait4(int pid, int *status, \
183 int options, struct rusage *rusage); }
184 62 STD { int linux_sys_kill(int pid, int signum); }
185 63 STD { int linux_sys_uname(struct linux_utsname *up); }
186 #ifdef SYSVSEM
187 64 NOARGS { int sys_semget(key_t key, int nsems, int semflg); }
188 65 NOARGS { int sys_semop(int semid, struct sembuf *sops, \
189 size_t nsops); }
190 66 STD { int linux_sys_semctl(int semid, int semnum, \
191 int cmd, union linux_semun arg); }
192 #else
193 64 UNIMPL semget
194 65 UNIMPL semop
195 66 UNIMPL semctl
196 #endif
197 #ifdef SYSVSHM
198 67 NOARGS { int sys_shmdt(const void *shmaddr); }
199 #else
200 67 UNIMPL shmdt
201 #endif
202 #ifdef SYSVMSG
203 68 NOARGS { int sys_msgget(key_t key, int msgflg); }
204 69 NOARGS { int sys_msgsnd(int msqid, void *msgp, size_t msgsz, \
205 int msgflg); }
206 70 NOARGS { ssize_t sys_msgrcv(int msqid, void *msgp, \
207 size_t msgsz, long msgtyp, int msgflg); }
208 71 NOARGS { int linux_sys_msgctl(int msqid, int cmd, \
209 struct linux_msqid_ds *buf); }
210 #else
211 68 UNIMPL msgget
212 69 UNIMPL msgsnd
213 70 UNIMPL msgrcv
214 71 UNIMPL msgctl
215 #endif
216 72 STD { int linux_sys_fcntl(int fd, int cmd, void *arg); }
217 73 NOARGS { int sys_flock(int fd, int how); }
218 74 NOARGS { int sys_fsync(int fd); }
219 75 STD { int linux_sys_fdatasync(int fd); }
220 76 STD { int linux_sys_truncate64(const char *path, \
221 off_t length); }
222 77 STD { int linux_sys_ftruncate64(unsigned int fd, \
223 off_t length); }
224 78 STD { int linux_sys_getdents(int fd, \
225 struct linux_dirent *dent, unsigned int count); }
226 79 NOARGS { int sys___getcwd(char *bufp, size_t length); }
227 80 NOARGS { int sys_chdir(const char *path); }
228 81 NOARGS { int sys_fchdir(int fd); }
229 82 NOARGS { int sys___posix_rename(const char *from, \
230 const char *to); }
231 83 NOARGS { int sys_mkdir(const char *path, int mode); }
232 84 NOARGS { int sys_rmdir(const char *path); }
233 85 STD { int linux_sys_creat(const char *path, int mode); }
234 86 NOARGS { int sys_link(const char *path, const char *link); }
235 87 STD { int linux_sys_unlink(const char *path); }
236 88 NOARGS { int sys_symlink(const char *path, const char *to); }
237 89 NOARGS { int sys_readlink(const char *name, char *buf, \
238 int count); }
239 90 NOARGS { int sys_chmod(const char *path, int mode); }
240 91 NOARGS { int sys_fchmod(int fd, int mode); }
241 92 NOARGS { int sys___posix_chown(const char *path, uid_t uid, \
242 gid_t gid); }
243 93 NOARGS { int sys___posix_fchown(int fd, uid_t uid, \
244 gid_t gid); }
245 94 NOARGS { int sys___posix_lchown(const char *path, uid_t uid, \
246 gid_t gid); }
247 95 NOARGS { int sys_umask(int newmask); }
248 96 STD { int linux_sys_gettimeofday(struct timeval *tp, \
249 struct timezone *tzp); }
250 97 STD { int linux_sys_getrlimit(int which, \
251 struct rlimit *rlp); }
252 98 NOARGS { int compat_50_sys_getrusage(int who, struct rusage50 *rusage); }
253 99 STD { int linux_sys_sysinfo(struct linux_sysinfo *arg); }
254 100 STD { int linux_sys_times(struct times *tms); }
255 101 STD { int linux_sys_ptrace(long request, long pid, \
256 long addr, long data); }
257 102 NOARGS { uid_t sys_getuid(void); }
258 103 UNIMPL syslog
259 104 NOARGS { gid_t sys_getgid(void); }
260 105 NOARGS { void sys_setuid(uid_t uid); }
261 106 NOARGS { void sys_setgid(gid_t gid); }
262 107 NOARGS { uid_t sys_geteuid(void); }
263 108 NOARGS { gid_t sys_getegid(void); }
264 109 NOARGS { int sys_setpgid(int pid, int pgid); }
265 110 STD { pid_t linux_sys_getppid(void); }
266 111 NOARGS { int sys_getpgrp(void); }
267 112 NOARGS { int sys_setsid(void); }
268 113 NOARGS { int sys_setreuid(uid_t ruid, uid_t euid); }
269 114 NOARGS { int sys_setregid(gid_t rgid, gid_t egid); }
270 115 NOARGS { int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
271 116 NOARGS { int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
272 117 STD { int linux_sys_setresuid(uid_t ruid, uid_t euid, \
273 uid_t suid); }
274 118 STD { int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \
275 uid_t *suid); }
276 119 STD { int linux_sys_setresgid(gid_t rgid, gid_t egid, \
277 gid_t sgid); }
278 120 STD { int linux_sys_getresgid(gid_t *rgid, gid_t *egid, \
279 gid_t *sgid); }
280 121 NOARGS { pid_t sys_getpgid(pid_t pid); }
281 122 STD { int linux_sys_setfsuid(uid_t uid); }
282 123 STD { int linux_sys_setfsgid(gid_t gid); }
283 124 NOARGS { pid_t sys_getsid(pid_t pid); }
284 125 UNIMPL capget
285 126 UNIMPL capset
286 127 STD { int linux_sys_rt_sigpending( \
287 linux_sigset_t *set, \
288 size_t sigsetsize); }
289 128 UNIMPL rt_sigtimedwait
290 129 STD { int linux_sys_rt_queueinfo(int pid, int signum, \
291 siginfo_t *uinfo); }
292 130 STD { int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
293 size_t sigsetsize); }
294 131 STD { int linux_sys_sigaltstack( \
295 const struct linux_sigaltstack *ss, \
296 struct linux_sigaltstack *oss); }
297 132 STD { int linux_sys_utime(const char *path, \
298 struct linux_utimbuf *times); }
299 133 STD { int linux_sys_mknod(const char *path, int mode, \
300 int dev); }
301 #ifdef EXEC_AOUT
302 134 STD { int linux_sys_uselib(const char *path); }
303 #else
304 134 UNIMPL sys_uselib
305 #endif
306 135 STD { int linux_sys_personality(int per); }
307 136 UNIMPL ustat
308 137 STD { int linux_sys_statfs(const char *path, \
309 struct linux_statfs *sp); }
310 138 STD { int linux_sys_fstatfs(int fd, \
311 struct linux_statfs *sp); }
312 139 UNIMPL sysfs
313 140 STD { int linux_sys_getpriority(int which, int who); }
314 141 NOARGS { int sys_setpriority(int which, int who, int prio); }
315 142 STD { int linux_sys_sched_setparam(pid_t pid, \
316 const struct linux_sched_param *sp); }
317 143 STD { int linux_sys_sched_getparam(pid_t pid, \
318 struct linux_sched_param *sp); }
319 144 STD { int linux_sys_sched_setscheduler(pid_t pid, \
320 int policy, const struct linux_sched_param *sp); }
321 145 STD { int linux_sys_sched_getscheduler(pid_t pid); }
322 146 STD { int linux_sys_sched_get_priority_max(int policy); }
323 147 STD { int linux_sys_sched_get_priority_min(int policy); }
324 148 UNIMPL sys_sched_rr_get_interval
325 149 NOARGS { int sys_mlock(void *addr, size_t len); }
326 150 NOARGS { int sys_munlock(void *addr, size_t len); }
327 151 NOARGS { int sys_mlockall(int flags); }
328 152 NOARGS { int sys_munlockall(void); }
329 153 UNIMPL vhangup
330 154 STD { int linux_sys_modify_ldt(int func, void *ptr, \
331 size_t bytecount); }
332 155 UNIMPL pivot_root
333 156 STD { int linux_sys___sysctl(struct linux___sysctl *lsp); }
334 157 UNIMPL prctl
335 158 STD { int linux_sys_arch_prctl(int code, \
336 unsigned long addr); }
337 159 UNIMPL adjtimex
338 160 STD { int linux_sys_setrlimit(u_int which, \
339 struct rlimit *rlp); }
340 161 NOARGS { int sys_chroot(char *path); }
341 162 NOARGS { int sys_sync(void); }
342 163 NOARGS { int sys_acct(char *path); }
343 164 STD { int linux_sys_settimeofday(struct timeval *tp, \
344 struct timezone *tzp); }
345 165 UNIMPL mount
346 166 UNIMPL umount2
347 167 STD { int linux_sys_swapon(char *name); }
348 168 STD { int linux_sys_swapoff(const char *path); }
349 169 STD { int linux_sys_reboot(int magic1, int magic2, \
350 int cmd, void *arg); }
351 170 NOARGS { int compat_43_sys_sethostname(char *hostname, \
352 u_int len);}
353 171 STD { int linux_sys_setdomainname(char *domainname, \
354 int len); }
355 172 STD { int linux_sys_iopl(int level); }
356 173 STD { int linux_sys_ioperm(unsigned int lo, \
357 unsigned int hi, int val); }
358 174 UNIMPL create_module
359 175 UNIMPL init_module
360 176 UNIMPL delete_module
361 177 UNIMPL get_kernel_syms
362 178 UNIMPL query_module
363 179 UNIMPL quotactl
364 180 UNIMPL nfsservctl
365 181 UNIMPL getpmsg
366 182 UNIMPL putpmsg
367 183 UNIMPL afs_syscall
368 184 UNIMPL tuxcall
369 185 UNIMPL security
370 186 STD { pid_t linux_sys_gettid(void); }
371 187 UNIMPL readahead
372 188 STD { int linux_sys_setxattr(char *path, char *name, \
373 void *value, size_t size, int flags); }
374 189 STD { int linux_sys_lsetxattr(char *path, char *name, \
375 void *value, size_t size, int flags); }
376 190 STD { int linux_sys_fsetxattr(int fd, char *name, \
377 void *value, size_t size, int flags); }
378 191 STD { ssize_t linux_sys_getxattr(char *path, char *name, \
379 void *value, size_t size); }
380 192 STD { ssize_t linux_sys_lgetxattr(char *path, char *name, \
381 void *value, size_t size); }
382 193 STD { ssize_t linux_sys_fgetxattr(int fd, char *name, \
383 void *value, size_t size); }
384 194 STD { ssize_t linux_sys_listxattr(char *path, char *list, \
385 size_t size); }
386 195 STD { ssize_t linux_sys_llistxattr(char *path, char *list, \
387 size_t size); }
388 196 STD { ssize_t linux_sys_flistxattr(int fd, char *list, \
389 size_t size); }
390 197 STD { int linux_sys_removexattr(char *path, char *name); }
391 198 STD { int linux_sys_lremovexattr(char *path, char *name); }
392 199 STD { int linux_sys_fremovexattr(int fd, char *name); }
393 200 STD { int linux_sys_tkill(int tid, int sig); }
394 201 STD { int linux_sys_time(linux_time_t *t); }
395 202 STD { int linux_sys_futex(int *uaddr, int op, int val, \
396 const struct linux_timespec *timeout, int *uaddr2, \
397 int val3); }
398 203 STD { int linux_sys_sched_setaffinity(pid_t pid, \
399 unsigned int len, unsigned long *mask); }
400 204 STD { int linux_sys_sched_getaffinity(pid_t pid, \
401 unsigned int len, unsigned long *mask); }
402 205 UNIMPL set_thread_area
403 206 UNIMPL io_setup
404 207 UNIMPL io_destroy
405 208 UNIMPL io_getevents
406 209 UNIMPL io_submit
407 210 UNIMPL io_cancel
408 211 UNIMPL get_thread_area
409 212 UNIMPL lookup_dcookie
410 213 UNIMPL epoll_create
411 214 UNIMPL epoll_ctl_old
412 215 UNIMPL epoll_wait_old
413 216 UNIMPL remap_file_pages
414 217 STD { int linux_sys_getdents64(int fd, \
415 struct linux_dirent64 *dent, unsigned int count); }
416 218 STD { int linux_sys_set_tid_address(int *tid); }
417 219 UNIMPL restart_syscall
418 220 UNIMPL semtimedop
419 221 UNIMPL fadvise64
420 222 UNIMPL timer_create
421 223 UNIMPL timer_settime
422 224 UNIMPL timer_gettime
423 225 UNIMPL timer_getoverrun
424 226 UNIMPL timer_delete
425 227 STD { int linux_sys_clock_settime(clockid_t which, \
426 struct linux_timespec *tp); }
427 228 STD { int linux_sys_clock_gettime(clockid_t which, \
428 struct linux_timespec *tp); }
429 229 STD { int linux_sys_clock_getres(clockid_t which, \
430 struct linux_timespec *tp); }
431 230 STD { int linux_sys_clock_nanosleep(clockid_t which, \
432 int flags, struct linux_timespec *rqtp, \
433 struct linux_timespec *rmtp); }
434 231 STD { int linux_sys_exit_group(int error_code); }
435 232 UNIMPL epoll_wait
436 233 UNIMPL epoll_ctl
437 234 STD { int linux_sys_tgkill(int tgid, int tid, int sig); }
438 235 UNIMPL utimes
439 236 UNIMPL vserver
440 237 UNIMPL mbind
441 238 UNIMPL set_mempolicy
442 239 UNIMPL get_mempolicy
443 240 UNIMPL mq_open
444 241 UNIMPL mq_unlink
445 242 UNIMPL mq_timedsend
446 243 UNIMPL mq_timedreceive
447 244 UNIMPL mq_notify
448 245 UNIMPL mq_getsetattr
449 246 UNIMPL kexec_load
450 247 UNIMPL waitid
451 248 UNIMPL add_key
452 249 UNIMPL request_key
453 250 UNIMPL keyctl
454 251 UNIMPL ioprio_set
455 252 UNIMPL ioprio_get
456 253 UNIMPL inotify_init
457 254 UNIMPL inotify_add_watch
458 255 UNIMPL inotify_rm_watch
459 256 UNIMPL migrate_pages
460 257 UNIMPL openat
461 258 UNIMPL mkdirat
462 259 UNIMPL mknodat
463 260 UNIMPL fchownat
464 261 UNIMPL futimesat
465 262 UNIMPL newfstatat
466 263 UNIMPL unlinkat
467 264 UNIMPL renameat
468 265 UNIMPL linkat
469 266 UNIMPL symlinkat
470 267 UNIMPL readlinkat
471 268 UNIMPL fchmodat
472 269 UNIMPL faccessat
473 270 UNIMPL pselect6
474 271 UNIMPL ppoll
475 272 UNIMPL unshare
476 273 STD { int linux_sys_set_robust_list( \
477 struct linux_robust_list_head *head, size_t len); }
478 274 STD { int linux_sys_get_robust_list(int pid, \
479 struct linux_robust_list_head **head, \
480 size_t *len); }
481 275 UNIMPL splice
482 276 UNIMPL tee
483 277 UNIMPL sync_file_range
484 278 UNIMPL vmsplice
485 279 UNIMPL move_pages
486 280 UNIMPL utimensat
487 281 UNIMPL epoll_pwait
488 282 UNIMPL signalfd
489 283 UNIMPL timerfd_create
490 284 UNIMPL eventfd
491 285 UNIMPL fallocate
492 286 STD { int linux_sys_nosys(void); }
493