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