syscalls.master revision 1.13 1 $NetBSD: syscalls.master,v 1.13 1999/12/05 21:24:28 tron Exp $
2
3 ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
4
5 ; NetBSD alpha 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 ; (ERH: 5/26/98)
37 ;
38 ; XXX XAX todo:
39 ; check arguments.
40 ; kill not used functions. (ifdef the actual code)
41 ;
42 ; NOT USED = This syscall is not really used in Linux, except in its
43 ; osf compat mode. Since Linux binaries shouldn't ever
44 ; call it and osf binaries run under a different emulation,
45 ; it shouldn't matter that the linux version of the
46 ; function might not DTRT. Define it anyway so we
47 ; don't have to split off or ifdef the associated function.
48 ; A bit better might be to have makesyscalls identify this
49 ; as "define but don't include in table" so it doesn't actually
50 ; ever get called.
51 ; UNIMPL <blank> = not implemented here nor in linux source
52 ; UNIMPL osf_* = osf functions implemented in linux, not here.
53 ;
54
55 #include "opt_sysv.h"
56 #include "opt_compat_43.h"
57
58 #include <sys/param.h>
59 #include <sys/poll.h>
60 #include <sys/systm.h>
61 #include <sys/signal.h>
62 #include <sys/mount.h>
63 #include <sys/syscallargs.h>
64
65 #include <compat/linux/common/linux_types.h>
66 #include <compat/linux/common/linux_signal.h>
67 #include <compat/linux/common/linux_siginfo.h>
68 #include <compat/linux/common/linux_ipc.h>
69 #include <compat/linux/common/linux_msg.h>
70 #include <compat/linux/common/linux_sem.h>
71 #include <compat/linux/common/linux_shm.h>
72 #include <compat/linux/common/linux_mmap.h>
73 ;#include <compat/linux/common/linux_machdep.h>
74
75 #include <compat/linux/linux_syscallargs.h>
76
77
78 0 NOARGS { int sys_nosys(void); } syscall
79 1 NOARGS { int sys_exit(int rval); }
80 2 NOARGS { int sys_fork(void); }
81 3 NOARGS { int sys_read(int fd, char *buf, u_int nbyte); }
82 4 NOARGS { int sys_write(int fd, char *buf, u_int nbyte); }
83 5 UNIMPL
84 6 NOARGS { int sys_close(int fd); }
85 7 UNIMPL osf_wait4
86 ;8 OBSOL osf_old_creat, NOT USED. XXX XAX
87 8 STD { int linux_sys_creat(char *path, int mode); }
88 9 NOARGS { int sys_link(char *path, char *link); }
89 10 STD { int linux_sys_unlink(char *path); }
90 11 UNIMPL
91 12 STD { int linux_sys_chdir(char *path); }
92 13 NOARGS { int sys_fchdir(int fd); }
93 14 STD { int linux_sys_mknod(char *path, int mode, int dev); }
94 15 STD { int linux_sys_chmod(char *path, int mode); }
95 16 STD { int linux_sys_chown(char *path, int uid, int gid); }
96 ;17 ALIAS osf_brk
97 17 STD { int linux_sys_brk(char *nsize); }
98 18 UNIMPL
99 19 NOARGS { long compat_43_sys_lseek(int fd, long offset, \
100 int whence); }
101 20 NOARGS { pid_t sys_getpid(void); }
102 21 UNIMPL osf_mount
103 22 UNIMPL osf_umount
104 23 NOARGS { int sys_setuid(uid_t uid); }
105 24 NOARGS { uid_t sys_getuid(void); }
106 25 UNIMPL
107 26 UNIMPL ptrace
108 27 UNIMPL
109 28 UNIMPL
110 29 UNIMPL
111 30 UNIMPL
112 31 UNIMPL
113 32 UNIMPL
114 33 STD { int linux_sys_access(char *path, int flags); }
115 34 UNIMPL
116 35 UNIMPL
117 36 NOARGS { int sys_sync(void); }
118 37 STD { int linux_sys_kill(int pid, int signum); }
119 38 UNIMPL
120 39 NOARGS { int sys_setpgid(int pid, int pgid); }
121 40 UNIMPL
122 41 NOARGS { int sys_dup(u_int fd); }
123 42 NOARGS { int linux_sys_pipe(void); }
124 43 UNIMPL osf_set_program_attributes
125 44 UNIMPL
126 45 STD { int linux_sys_open(char *path, int flags, int mode); }
127 46 UNIMPL
128 47 NOARGS { gid_t sys_getgid(void); }
129 48 UNIMPL osf_sigprocmask
130 49 UNIMPL
131 50 UNIMPL
132 51 NOARGS { int sys_acct(char *path); }
133 52 STD { int linux_sys_sigpending(linux_old_sigset_t *set); }
134 53 UNIMPL
135 54 STD { int linux_sys_ioctl(int fd, u_long com, \
136 caddr_t data); }
137 55 UNIMPL
138 56 UNIMPL
139 57 STD { int linux_sys_symlink(char *path, char *to); }
140 58 STD { int linux_sys_readlink(char *name, char *buf, \
141 int count); }
142 59 STD { int linux_sys_execve(char *path, char **argp, \
143 char **envp); }
144 60 NOARGS { int sys_umask(int newmask); }
145 61 NOARGS { int sys_chroot(char *path); }
146 62 UNIMPL
147 63 NOARGS { int sys_getpgrp(void); }
148 64 NOARGS { int compat_43_sys_getpagesize(void); }
149 65 UNIMPL
150 66 NOARGS { int sys___vfork14(void); }
151 67 STD { int linux_sys_stat(char *path, \
152 struct linux_stat *sp); }
153 68 STD { int linux_sys_lstat(char *path, \
154 struct linux_stat *sp); }
155 69 UNIMPL
156 70 UNIMPL
157 71 NOARGS { int linux_sys_mmap(unsigned long addr, size_t len, \
158 int prot, int flags, int fd, off_t offset); }
159 72 UNIMPL
160 73 NOARGS { int sys_munmap(caddr_t addr, int len); }
161 74 NOARGS { int sys_mprotect(caddr_t addr, int len, int prot); }
162 75 UNIMPL madvise
163 76 UNIMPL vhangup
164 77 UNIMPL
165 78 UNIMPL
166 79 NOARGS { int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
167 80 NOARGS { int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
168 81 UNIMPL
169 82 UNIMPL setpgrp
170 ;83: Uses int for seconds, and time_t. so need different itimerval struct.
171 83 UNIMPL osf_setitimer
172 84 UNIMPL
173 85 UNIMPL
174 ;86: Uses int for seconds, and time_t. so need different itimerval struct.
175 86 UNIMPL osf_getitimer
176 ; XXX XAX here, check args match.
177 87 NOARGS { int compat_43_sys_gethostname(char *hostname, \
178 u_int len); }
179 88 NOARGS { int compat_43_sys_sethostname(char *hostname, \
180 u_int len); }
181 89 UNIMPL getdtablesize
182 90 NOARGS { int sys_dup2(u_int from, u_int to); }
183 91 STD { int linux_sys_fstat(int fd, struct linux_stat *sp); }
184 92 STD { int linux_sys_fcntl(int fd, int cmd, void *arg); }
185 93 UNIMPL osf_select
186 94 NOARGS { int sys_poll(struct pollfd *fds, u_int nfds, \
187 int timeout); }
188 95 NOARGS { int sys_fsync(int fd); }
189 96 NOARGS { int sys_setpriority(int which, int who, int prio); }
190 97 STD { int linux_sys_socket(int domain, int type, \
191 int protocol); }
192 98 NOARGS { int sys_connect(int s, const struct sockaddr *name, \
193 int namelen); }
194 99 NOARGS { int compat_43_sys_accept(int s, \
195 caddr_t name, int *anamelen); }
196 ;100 ALIAS osf_getpriority
197 100 NOARGS { int sys_getpriority(int which, int who); }
198 101 NOARGS { int compat_43_sys_send(int s, caddr_t buf, int len, \
199 int flags); }
200 102 NOARGS { int compat_43_sys_recv(int s, caddr_t buf, int len, \
201 int flags); }
202 103 STD { int linux_sys_sigreturn(struct linux_sigframe *sfp); }
203 104 NOARGS { int sys_bind(int s, const struct sockaddr *name, \
204 int namelen); }
205 105 STD { int linux_sys_setsockopt(int s, int level, \
206 int optname, void *optval, int optlen); }
207 106 NOARGS { int sys_listen(int s, int backlog); }
208 107 UNIMPL
209 108 UNIMPL
210 109 UNIMPL
211 110 UNIMPL
212
213 111 STD { int linux_sys_sigsuspend(caddr_t restart, \
214 int oldmask, int mask); }
215 112 UNIMPL
216 113 NOARGS { int sys_recvmsg(int fd, struct msghdr *msg, \
217 u_int flags); }
218 114 NOARGS { int sys_sendmsg(int fd, struct msghdr *msg, \
219 u_int flags); }
220 115 UNIMPL
221 116 UNIMPL osf_gettimeofday
222 117 UNIMPL osf_getrusage
223 118 STD { int linux_sys_getsockopt(int s, int level, \
224 int optname, void *optval, int *optlen); }
225 119 UNIMPL
226 120 NOARGS { int sys_readv(int fd, struct iovec *iovp, \
227 u_int iovcnt); }
228 121 NOARGS { int sys_writev(int fd, struct iovec *iovp, \
229 u_int iovcnt); }
230 122 UNIMPL osf_settimeofday
231 123 STD { int linux_sys_fchown(int fd, int uid, int gid); }
232 124 NOARGS { int sys_fchmod(int fd, int mode); }
233 125 STD { int linux_sys_recvfrom(int s, void *buf, int len, \
234 int flags, struct sockaddr *from, \
235 int *fromlen); }
236 126 STD { int linux_sys_setreuid(int ruid, int euid); }
237 127 STD { int linux_sys_setregid(int rgid, int egid); }
238 128 STD { int linux_sys_rename(char *from, char *to); }
239 129 STD { int linux_sys_truncate(char *path, long length); }
240 130 NOARGS { int compat_43_sys_ftruncate(int fd, long length); }
241 131 NOARGS { int sys_flock(int fd, int how); }
242 132 NOARGS { int sys_setgid(gid_t gid); }
243 133 STD { int linux_sys_sendto(int s, void *msg, int len, \
244 int flags, struct sockaddr *to, int tolen); }
245 134 NOARGS { int sys_shutdown(int s, int how); }
246 135 STD { int linux_sys_socketpair(int domain, int type, \
247 int protocol, int *rsv); }
248 136 STD { int linux_sys_mkdir(char *path, int mode); }
249 137 STD { int linux_sys_rmdir(char *path); }
250 138 UNIMPL osf_utimes
251 139 UNIMPL
252 140 UNIMPL
253 141 NOARGS { int compat_43_sys_getpeername(int fdes, \
254 caddr_t asa, int *alen); }
255 142 UNIMPL
256 143 UNIMPL
257 144 NOARGS { int compat_43_sys_getrlimit(u_int which, \
258 struct orlimit *rlp); }
259 145 NOARGS { int compat_43_sys_setrlimit(u_int which, \
260 struct orlimit *rlp); }
261 146 UNIMPL
262 147 NOARGS { int sys_setsid(void); }
263 148 UNIMPL quotactl
264 149 UNIMPL
265 150 NOARGS { int compat_43_sys_getsockname(int fdec, \
266 caddr_t asa, int *alen); }
267 151 UNIMPL
268 152 UNIMPL
269 153 UNIMPL
270 154 UNIMPL
271 155 UNIMPL
272 ;156 ALIAS osf_sigaction
273 156 STD { int linux_sys_sigaction(int signum, \
274 const struct linux_old_sigaction *nsa, \
275 struct linux_old_sigaction *osa); }
276 157 UNIMPL
277 158 UNIMPL
278 159 UNIMPL osf_getdirentries
279 160 UNIMPL osf_statfs
280 161 UNIMPL osf_fstatfs
281 162 UNIMPL
282 163 UNIMPL
283 164 UNIMPL
284 165 UNIMPL osf_getdomainname
285 ;166 ALIAS osf_setdomainname
286 166 UNIMPL setdomainname
287 167 UNIMPL
288 168 UNIMPL
289 169 UNIMPL
290 170 UNIMPL
291 171 UNIMPL
292 172 UNIMPL
293 173 UNIMPL
294 174 UNIMPL
295 175 UNIMPL
296 176 UNIMPL
297 177 UNIMPL
298 178 UNIMPL
299 179 UNIMPL
300 180 UNIMPL
301 181 UNIMPL
302 182 UNIMPL
303 183 UNIMPL
304 184 UNIMPL
305 185 UNIMPL
306 186 UNIMPL
307 187 UNIMPL
308 188 UNIMPL
309 189 UNIMPL
310 190 UNIMPL
311 191 UNIMPL
312 192 UNIMPL
313 193 UNIMPL
314 194 UNIMPL
315 195 UNIMPL
316 196 UNIMPL
317 197 UNIMPL
318 198 UNIMPL
319 199 UNIMPL osf_swapon
320 #ifdef SYSVMSG
321 200 NOARGS { int linux_sys_msgctl(int msqid, int cmd, \
322 struct linux_msqid_ds *buf); }
323 201 NOARGS { int sys_msgget(key_t key, int msgflg); }
324 202 NOARGS { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \
325 int msgflg); }
326 203 NOARGS { int sys_msgsnd(int msqid, void *msgp, size_t msgsz, \
327 int msgflg); }
328 #else
329 200 UNIMPL msgctl
330 201 UNIMPL msgget
331 202 UNIMPL msgrcv
332 203 UNIMPL msgsnd
333 #endif
334 #ifdef SYSVSEM
335 204 NOARGS { int linux_sys_semctl(int semid, int semnum, \
336 int cmd, union linux_semun arg); }
337 205 NOARGS { int sys_semget(key_t key, int nsems, int semflg); }
338 206 NOARGS { int sys_semop(int semid, struct sembuf *sops, \
339 unsigned u_int nsops); }
340 #else
341 204 UNIMPL semctl
342 205 UNIMPL semget
343 206 UNIMPL semop
344 #endif
345 ;207 OBSOL osf_utsname, NOT USED XXX XAX
346 207 STD { int linux_sys_olduname(struct linux_old_utsname *up); }
347 208 STD { int linux_sys_lchown(char *path, int uid, int gid); }
348 #ifdef SYSVSHM
349 209 NOARGS { int linux_sys_shmat(int shmid, void *shmaddr, \
350 int shmflg, u_long *raddr); }
351 210 NOARGS { int linux_sys_shmctl(int shmid, int cmd, \
352 struct linux_shmid_ds *buf); }
353 211 NOARGS { int sys_shmdt(void *shmaddr); }
354 212 NOARGS { int sys_shmget(key_t key, int size, int shmflg); }
355 #else
356 209 UNIMPL shmat
357 210 UNIMPL shmctl
358 211 UNIMPL shmdt
359 212 UNIMPL shmget
360 #endif
361 213 UNIMPL
362 214 UNIMPL
363 215 UNIMPL
364 216 UNIMPL
365 217 STD { int linux_sys_msync(caddr_t addr, int len, int fl); }
366 218 UNIMPL osf_signal
367 219 UNIMPL
368 220 UNIMPL
369 221 UNIMPL
370 222 UNIMPL
371 223 UNIMPL
372 224 UNIMPL
373 225 UNIMPL
374 226 UNIMPL
375 227 UNIMPL
376 228 UNIMPL
377 229 UNIMPL
378 230 UNIMPL
379 231 UNIMPL
380 232 UNIMPL
381 233 STD { int linux_sys_getpgid(int pid); }
382 234 NOARGS { pid_t sys_getsid(pid_t pid); }
383 235 UNIMPL
384 236 UNIMPL
385 237 UNIMPL
386 238 UNIMPL
387 239 UNIMPL
388 240 UNIMPL
389 241 UNIMPL osf_sysinfo
390 242 UNIMPL
391 243 UNIMPL
392 244 UNIMPL osf_proplist_syscall
393 245 UNIMPL
394 246 UNIMPL
395 247 UNIMPL
396 248 UNIMPL
397 249 UNIMPL
398 250 UNIMPL
399 251 UNIMPL osf_usleep_thread
400 252 UNIMPL
401 253 UNIMPL
402 254 UNIMPL sysfs
403 255 UNIMPL
404 256 UNIMPL osf_getsysinfo
405 257 UNIMPL osf_setsysinfo
406 258 UNIMPL
407 259 UNIMPL
408 260 UNIMPL
409 ; ???: fdatasync isn't implemented in Linux.
410 261 STD { int linux_sys_fdatasync(int fd); }
411 262 UNIMPL
412 263 UNIMPL
413 264 UNIMPL
414 265 UNIMPL
415 266 UNIMPL
416 267 UNIMPL
417 268 UNIMPL
418 269 UNIMPL
419 270 UNIMPL
420 271 UNIMPL
421 272 UNIMPL
422 273 UNIMPL
423 274 UNIMPL
424 275 UNIMPL
425 276 UNIMPL
426 277 UNIMPL
427 278 UNIMPL
428 279 UNIMPL
429 280 UNIMPL
430 281 UNIMPL
431 282 UNIMPL
432 283 UNIMPL
433 284 UNIMPL
434 285 UNIMPL
435 286 UNIMPL
436 287 UNIMPL
437 288 UNIMPL
438 289 UNIMPL
439 290 UNIMPL
440 291 UNIMPL
441 292 UNIMPL
442 293 UNIMPL
443 294 UNIMPL
444 295 UNIMPL
445 296 UNIMPL
446 297 UNIMPL
447 298 UNIMPL
448 299 UNIMPL
449 300 UNIMPL bdflush
450 301 UNIMPL sethae
451 302 UNIMPL mount
452 303 UNIMPL old_adjtimex
453 304 UNIMPL swapoff
454 305 STD { int linux_sys_getdents(int fd, \
455 struct linux_dirent *dent, unsigned int count); }
456 306 UNIMPL create_module
457 307 UNIMPL init_module
458 308 UNIMPL delete_module
459 309 UNIMPL get_kernel_syms
460 310 UNIMPL syslog
461 311 NOARGS { int sys_reboot(int opt); }
462 312 UNIMPL { int linux_sys_clone(int flags, void *stack); }
463 ; XXX XAX does alpha linux really have a.out exec?
464 #ifdef EXEC_AOUT
465 313 STD { int linux_sys_uselib(char *path); }
466 #else
467 313 UNIMPL sys_uselib
468 #endif
469 314 NOARGS { int sys_mlock(const void *addr, size_t len); }
470 315 NOARGS { int sys_munlock(const void *addr, size_t len); }
471 316 UNIMPL mlockall
472 317 UNIMPL munlockall
473 318 UNIMPL sysinfo
474 319 STD { int linux_sys___sysctl(struct linux___sysctl *lsp); }
475 320 UNIMPL idle
476 321 UNIMPL umount
477 322 NOARGS { int compat_12_sys_swapon(char *name); }
478 323 STD { int linux_sys_times(struct times *tms); }
479 324 STD { int linux_sys_personality(int per); }
480 325 UNIMPL setfsuid
481 326 UNIMPL setfsgid
482 327 UNIMPL ustat
483 328 STD { int linux_sys_statfs(char *path, \
484 struct linux_statfs *sp); }
485 329 STD { int linux_sys_fstatfs(int fd, \
486 struct linux_statfs *sp); }
487 330 STD { int linux_sys_sched_setparam(pid_t pid, \
488 const struct linux_sched_param *sp); }
489 331 STD { int linux_sys_sched_getparam(pid_t pid, \
490 struct linux_sched_param *sp); }
491 332 STD { int linux_sys_sched_setscheduler(pid_t pid, \
492 int policy, const struct linux_sched_param *sp); }
493 333 STD { int linux_sys_sched_getscheduler(pid_t pid); }
494 334 STD { int linux_sys_sched_yield(void); }
495 335 STD { int linux_sys_sched_get_priority_max(int policy); }
496 336 STD { int linux_sys_sched_get_priority_min(int policy); }
497 337 UNIMPL sched_rr_get_interval
498 338 UNIMPL afs_syscall
499 339 STD { int linux_sys_uname(struct linux_utsname *up); }
500 340 NOARGS { int sys_nanosleep(const struct timespec *rqtp, \
501 struct timespec *rmtp); }
502 341 STD { void *linux_sys_mremap(void *old_address, \
503 size_t old_size, size_t new_size, u_long flags); }
504 342 UNIMPL nfsservctl
505 343 STD { int linux_sys_setresuid(uid_t ruid, uid_t euid, \
506 uid_t suid); }
507 344 STD { int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \
508 uid_t *suid); }
509 345 UNIMPL pciconfig_read
510 346 UNIMPL pciconfig_write
511 347 UNIMPL query_module
512 348 UNIMPL prctl
513 340 STD { int linux_sys_pread(int fd, char *buf, \
514 size_t nbyte, linux_off_t offset); }
515 350 STD { int linux_sys_pwrite(int fd, char *buf, \
516 size_t nbyte, linux_off_t offset); }
517 351 STD { int linux_sys_rt_sigreturn( \
518 struct linux_rt_sigframe *sfp); }
519 352 STD { int linux_sys_rt_sigaction(int signum, \
520 const struct linux_sigaction *nsa, \
521 struct linux_sigaction *osa, \
522 size_t sigsetsize); }
523 353 STD { int linux_sys_rt_sigprocmask(int how, \
524 const linux_sigset_t *set, \
525 linux_sigset_t *oset, \
526 size_t sigsetsize); }
527 354 STD { int linux_sys_rt_sigpending( \
528 linux_sigset_t *set, \
529 size_t sigsetsize); }
530 355 UNIMPL rt_sigtimedwait
531 ; XXX XAX int here? sigset_t here?
532 356 STD { int linux_sys_rt_queueinfo(int pid, int signum, \
533 linux_siginfo_t *uinfo); }
534 357 STD { int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
535 size_t sigsetsize); }
536 358 STD { int linux_sys_select(int nfds, fd_set *readfds, \
537 fd_set *writefds, fd_set *exceptfds, \
538 struct timeval *timeout); }
539 359 NOARGS { int sys_gettimeofday(struct timeval *tp, \
540 struct timezone *tzp); }
541 360 NOARGS { int sys_settimeofday(struct timeval *tp, \
542 struct timezone *tzp); }
543 361 NOARGS { int sys_getitimer(u_int which, \
544 struct itimerval *itv); }
545 362 NOARGS { int sys_setitimer(u_int which, \
546 struct itimerval *itv, struct itimerval *oitv); }
547 ; XXX XAX Is this correct? no. utime is a lib call. utimes is the syscall
548 ; do we need translation here? I don't think so.
549 ; what?
550 363 NOARGS { int sys_utimes(char *path, \
551 struct timecal *times); }
552 364 NOARGS { int sys_getrusage(int who, struct rusage *rusage); }
553 365 STD { int linux_sys_wait4(int pid, int *status, \
554 int options, struct rusage *rusage); }
555 366 UNIMPL adjtimex
556 367 NOARGS { int sys___getcwd(char *bufp, size_t length); }
557 368 UNIMPL capget
558 369 UNIMPL capset
559 370 UNIMPL sendfile
560