1 $NetBSD: syscalls.master,v 1.67 1998/01/04 03:45:21 thorpej Exp $ 2 3; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 4 5; NetBSD 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 switch definition file only. 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/signal.h> 39#include <sys/mount.h> 40#include <sys/syscallargs.h> 41 42; Reserved/unimplemented system calls in the range 0-150 inclusive 43; are reserved for use in future Berkeley releases. 44; Additional system calls implemented in vendor and other 45; redistributions should be placed in the reserved range at the end 46; of the current calls. 47 480 INDIR { int sys_syscall(int number, ...); } 491 STD { void sys_exit(int rval); } 502 STD { int sys_fork(void); } 513 STD { ssize_t sys_read(int fd, void *buf, size_t nbyte); } 524 STD { ssize_t sys_write(int fd, const void *buf, \ 53 size_t nbyte); } 545 STD { int sys_open(const char *path, \ 55 int flags, ... mode_t mode); } 566 STD { int sys_close(int fd); } 577 STD { int sys_wait4(int pid, int *status, int options, \ 58 struct rusage *rusage); } 598 COMPAT_43 { int sys_creat(const char *path, mode_t mode); } ocreat 609 STD { int sys_link(const char *path, const char *link); } 6110 STD { int sys_unlink(const char *path); } 6211 OBSOL execv 6312 STD { int sys_chdir(const char *path); } 6413 STD { int sys_fchdir(int fd); } 6514 STD { int sys_mknod(const char *path, mode_t mode, \ 66 dev_t dev); } 6715 STD { int sys_chmod(const char *path, mode_t mode); } 6816 STD { int sys_chown(const char *path, uid_t uid, \ 69 gid_t gid); } 7017 STD { int sys_obreak(char *nsize); } break 7118 STD { int sys_getfsstat(struct statfs *buf, long bufsize, \ 72 int flags); } 7319 COMPAT_43 { long sys_lseek(int fd, long offset, int whence); } \ 74 olseek 7520 STD { pid_t sys_getpid(void); } 7621 STD { int sys_mount(const char *type, const char *path, \ 77 int flags, void *data); } 7822 STD { int sys_unmount(const char *path, int flags); } 7923 STD { int sys_setuid(uid_t uid); } 8024 STD { uid_t sys_getuid(void); } 8125 STD { uid_t sys_geteuid(void); } 8226 STD { int sys_ptrace(int req, pid_t pid, caddr_t addr, \ 83 int data); } 8427 STD { ssize_t sys_recvmsg(int s, struct msghdr *msg, \ 85 int flags); } 8628 STD { ssize_t sys_sendmsg(int s, \ 87 const struct msghdr *msg, int flags); } 8829 STD { ssize_t sys_recvfrom(int s, void *buf, size_t len, \ 89 int flags, struct sockaddr *from, \ 90 int *fromlenaddr); } 9130 STD { int sys_accept(int s, struct sockaddr *name, \ 92 int *anamelen); } 9331 STD { int sys_getpeername(int fdes, struct sockaddr *asa, \ 94 int *alen); } 9532 STD { int sys_getsockname(int fdes, struct sockaddr *asa, \ 96 int *alen); } 9733 STD { int sys_access(const char *path, int flags); } 9834 STD { int sys_chflags(const char *path, u_long flags); } 9935 STD { int sys_fchflags(int fd, u_long flags); } 10036 STD { void sys_sync(void); } 10137 STD { int sys_kill(int pid, int signum); } 10238 COMPAT_43 { int sys_stat(const char *path, struct stat43 *ub); } \ 103 stat43 10439 STD { pid_t sys_getppid(void); } 10540 COMPAT_43 { int sys_lstat(const char *path, \ 106 struct stat43 *ub); } lstat43 10741 STD { int sys_dup(int fd); } 10842 STD { int sys_pipe(void); } 10943 STD { gid_t sys_getegid(void); } 11044 STD { int sys_profil(caddr_t samples, size_t size, \ 111 u_long offset, u_int scale); } 112#ifdef KTRACE 11345 STD { int sys_ktrace(const char *fname, int ops, \ 114 int facs, int pid); } 115#else 11645 UNIMPL ktrace 117#endif 11846 STD { int sys_sigaction(int signum, \ 119 const struct sigaction *nsa, \ 120 struct sigaction *osa); } 12147 STD { gid_t sys_getgid(void); } 12248 STD { int sys_sigprocmask(int how, sigset_t mask); } 12349 STD { int sys___getlogin(char *namebuf, u_int namelen); } 12450 STD { int sys_setlogin(const char *namebuf); } 12551 STD { int sys_acct(const char *path); } 12652 STD { int sys_sigpending(void); } 12753 COMPAT_13 { int sys_sigaltstack(const struct sigaltstack13 \ 128 *nss, struct sigaltstack13 *oss); } sigaltstack13 12954 STD { int sys_ioctl(int fd, \ 130 u_long com, ... void *data); } 13155 COMPAT_12 { int sys_reboot(int opt); } oreboot 13256 STD { int sys_revoke(const char *path); } 13357 STD { int sys_symlink(const char *path, \ 134 const char *link); } 13558 STD { int sys_readlink(const char *path, char *buf, \ 136 int count); } 13759 STD { int sys_execve(const char *path, \ 138 char * const *argp, char * const *envp); } 13960 STD { mode_t sys_umask(mode_t newmask); } 14061 STD { int sys_chroot(const char *path); } 14162 COMPAT_43 { int sys_fstat(int fd, struct stat43 *sb); } fstat43 14263 COMPAT_43 { int sys_getkerninfo(int op, char *where, int *size, \ 143 int arg); } ogetkerninfo 14464 COMPAT_43 { int sys_getpagesize(void); } ogetpagesize 14565 COMPAT_12 { int sys_msync(caddr_t addr, size_t len); } 146; XXX COMPAT_??? for 4.4BSD-compatible vfork(2)? 14766 STD { int sys_vfork(void); } 14867 OBSOL vread 14968 OBSOL vwrite 15069 STD { int sys_sbrk(int incr); } 15170 STD { int sys_sstk(int incr); } 15271 COMPAT_43 { int sys_mmap(caddr_t addr, size_t len, int prot, \ 153 int flags, int fd, long pos); } ommap 15472 STD { int sys_ovadvise(int anom); } vadvise 15573 STD { int sys_munmap(void *addr, size_t len); } 15674 STD { int sys_mprotect(void *addr, size_t len, \ 157 int prot); } 15875 STD { int sys_madvise(void *addr, size_t len, \ 159 int behav); } 16076 OBSOL vhangup 16177 OBSOL vlimit 16278 STD { int sys_mincore(caddr_t addr, size_t len, \ 163 char *vec); } 16479 STD { int sys_getgroups(int gidsetsize, \ 165 gid_t *gidset); } 16680 STD { int sys_setgroups(int gidsetsize, \ 167 const gid_t *gidset); } 16881 STD { int sys_getpgrp(void); } 16982 STD { int sys_setpgid(int pid, int pgid); } 17083 STD { int sys_setitimer(int which, \ 171 const struct itimerval *itv, \ 172 struct itimerval *oitv); } 17384 COMPAT_43 { int sys_wait(void); } owait 17485 COMPAT_12 { int sys_swapon(const char *name); } oswapon 17586 STD { int sys_getitimer(int which, \ 176 struct itimerval *itv); } 17787 COMPAT_43 { int sys_gethostname(char *hostname, u_int len); } \ 178 ogethostname 17988 COMPAT_43 { int sys_sethostname(char *hostname, u_int len); } \ 180 osethostname 18189 COMPAT_43 { int sys_getdtablesize(void); } ogetdtablesize 18290 STD { int sys_dup2(int from, int to); } 18391 UNIMPL getdopt 18492 STD { int sys_fcntl(int fd, int cmd, ... void *arg); } 18593 STD { int sys_select(int nd, fd_set *in, fd_set *ou, \ 186 fd_set *ex, struct timeval *tv); } 18794 UNIMPL setdopt 18895 STD { int sys_fsync(int fd); } 18996 STD { int sys_setpriority(int which, int who, int prio); } 19097 STD { int sys_socket(int domain, int type, int protocol); } 19198 STD { int sys_connect(int s, const struct sockaddr *name, \ 192 int namelen); } 19399 COMPAT_43 { int sys_accept(int s, caddr_t name, \ 194 int *anamelen); } oaccept 195100 STD { int sys_getpriority(int which, int who); } 196101 COMPAT_43 { int sys_send(int s, caddr_t buf, int len, \ 197 int flags); } osend 198102 COMPAT_43 { int sys_recv(int s, caddr_t buf, int len, \ 199 int flags); } orecv 200103 STD { int sys_sigreturn(struct sigcontext *sigcntxp); } 201104 STD { int sys_bind(int s, const struct sockaddr *name, \ 202 int namelen); } 203105 STD { int sys_setsockopt(int s, int level, int name, \ 204 const void *val, int valsize); } 205106 STD { int sys_listen(int s, int backlog); } 206107 OBSOL vtimes 207108 COMPAT_43 { int sys_sigvec(int signum, struct sigvec *nsv, \ 208 struct sigvec *osv); } osigvec 209109 COMPAT_43 { int sys_sigblock(int mask); } osigblock 210110 COMPAT_43 { int sys_sigsetmask(int mask); } osigsetmask 211111 STD { int sys_sigsuspend(int mask); } 212112 COMPAT_43 { int sys_sigstack(struct sigstack *nss, \ 213 struct sigstack *oss); } osigstack 214113 COMPAT_43 { int sys_recvmsg(int s, struct omsghdr *msg, \ 215 int flags); } orecvmsg 216114 COMPAT_43 { int sys_sendmsg(int s, caddr_t msg, int flags); } \ 217 osendmsg 218#ifdef TRACE 219115 STD { int sys_vtrace(int request, int value); } 220#else 221115 OBSOL vtrace 222#endif 223116 STD { int sys_gettimeofday(struct timeval *tp, \ 224 struct timezone *tzp); } 225117 STD { int sys_getrusage(int who, struct rusage *rusage); } 226118 STD { int sys_getsockopt(int s, int level, int name, \ 227 void *val, int *avalsize); } 228119 OBSOL resuba 229120 STD { ssize_t sys_readv(int fd, \ 230 const struct iovec *iovp, int iovcnt); } 231121 STD { ssize_t sys_writev(int fd, \ 232 const struct iovec *iovp, int iovcnt); } 233122 STD { int sys_settimeofday(const struct timeval *tv, \ 234 const struct timezone *tzp); } 235123 STD { int sys_fchown(int fd, uid_t uid, gid_t gid); } 236124 STD { int sys_fchmod(int fd, mode_t mode); } 237125 COMPAT_43 { int sys_recvfrom(int s, caddr_t buf, size_t len, \ 238 int flags, caddr_t from, int *fromlenaddr); } \ 239 orecvfrom 240126 STD { int sys_setreuid(uid_t ruid, uid_t euid); } 241127 STD { int sys_setregid(gid_t rgid, gid_t egid); } 242128 STD { int sys_rename(const char *from, const char *to); } 243129 COMPAT_43 { int sys_truncate(const char *path, long length); } \ 244 otruncate 245130 COMPAT_43 { int sys_ftruncate(int fd, long length); } oftruncate 246131 STD { int sys_flock(int fd, int how); } 247132 STD { int sys_mkfifo(const char *path, mode_t mode); } 248133 STD { ssize_t sys_sendto(int s, const void *buf, \ 249 size_t len, int flags, const struct sockaddr *to, \ 250 int tolen); } 251134 STD { int sys_shutdown(int s, int how); } 252135 STD { int sys_socketpair(int domain, int type, \ 253 int protocol, int *rsv); } 254136 STD { int sys_mkdir(const char *path, mode_t mode); } 255137 STD { int sys_rmdir(const char *path); } 256138 STD { int sys_utimes(const char *path, \ 257 const struct timeval *tptr); } 258139 OBSOL 4.2 sigreturn 259140 STD { int sys_adjtime(const struct timeval *delta, \ 260 struct timeval *olddelta); } 261141 COMPAT_43 { int sys_getpeername(int fdes, caddr_t asa, \ 262 int *alen); } ogetpeername 263142 COMPAT_43 { int32_t sys_gethostid(void); } ogethostid 264143 COMPAT_43 { int sys_sethostid(int32_t hostid); } osethostid 265144 COMPAT_43 { int sys_getrlimit(int which, \ 266 struct orlimit *rlp); } ogetrlimit 267145 COMPAT_43 { int sys_setrlimit(int which, \ 268 const struct orlimit *rlp); } osetrlimit 269146 COMPAT_43 { int sys_killpg(int pgid, int signum); } okillpg 270147 STD { int sys_setsid(void); } 271148 STD { int sys_quotactl(const char *path, int cmd, \ 272 int uid, caddr_t arg); } 273149 COMPAT_43 { int sys_quota(void); } oquota 274150 COMPAT_43 { int sys_getsockname(int fdec, caddr_t asa, \ 275 int *alen); } ogetsockname 276 277; Syscalls 151-180 inclusive are reserved for vendor-specific 278; system calls. (This includes various calls added for compatibity 279; with other Unix variants.) 280; Some of these calls are now supported by BSD... 281151 UNIMPL 282152 UNIMPL 283153 UNIMPL 284154 UNIMPL 285#if defined(NFS) || defined(NFSSERVER) 286155 STD { int sys_nfssvc(int flag, void *argp); } 287#else 288155 UNIMPL 289#endif 290156 COMPAT_43 { int sys_getdirentries(int fd, char *buf, \ 291 u_int count, long *basep); } ogetdirentries 292157 STD { int sys_statfs(const char *path, \ 293 struct statfs *buf); } 294158 STD { int sys_fstatfs(int fd, struct statfs *buf); } 295159 UNIMPL 296160 UNIMPL 297#if defined(NFS) || defined(NFSSERVER) 298161 STD { int sys_getfh(const char *fname, fhandle_t *fhp); } 299#else 300161 UNIMPL getfh 301#endif 302162 COMPAT_09 { int sys_getdomainname(char *domainname, int len); } \ 303 ogetdomainname 304163 COMPAT_09 { int sys_setdomainname(char *domainname, int len); } \ 305 osetdomainname 306164 COMPAT_09 { int sys_uname(struct outsname *name); } ouname 307165 STD { int sys_sysarch(int op, char *parms); } 308166 UNIMPL 309167 UNIMPL 310168 UNIMPL 311; XXX more generally, never on machines where sizeof(void *) != sizeof(int) 312#if defined(SYSVSEM) && !defined(alpha) 313169 COMPAT_10 { int sys_semsys(int which, int a2, int a3, int a4, \ 314 int a5); } osemsys 315#else 316169 UNIMPL 1.0 semsys 317#endif 318; XXX more generally, never on machines where sizeof(void *) != sizeof(int) 319#if defined(SYSVMSG) && !defined(alpha) 320170 COMPAT_10 { int sys_msgsys(int which, int a2, int a3, int a4, \ 321 int a5, int a6); } omsgsys 322#else 323170 UNIMPL 1.0 msgsys 324#endif 325; XXX more generally, never on machines where sizeof(void *) != sizeof(int) 326#if defined(SYSVSHM) && !defined(alpha) 327171 COMPAT_10 { int sys_shmsys(int which, int a2, int a3, int a4); } \ 328 oshmsys 329#else 330171 UNIMPL 1.0 shmsys 331#endif 332172 UNIMPL 333173 UNIMPL 334174 UNIMPL 335175 STD { int sys_ntp_gettime(struct ntptimeval *ntvp); } 336176 STD { int sys_ntp_adjtime(struct timex *tp); } 337177 UNIMPL 338178 UNIMPL 339179 UNIMPL 340180 UNIMPL 341 342; Syscalls 180-199 are used by/reserved for BSD 343181 STD { int sys_setgid(gid_t gid); } 344182 STD { int sys_setegid(gid_t egid); } 345183 STD { int sys_seteuid(uid_t euid); } 346#ifdef LFS 347184 STD { int lfs_bmapv(fsid_t *fsidp, \ 348 struct block_info *blkiov, int blkcnt); } 349185 STD { int lfs_markv(fsid_t *fsidp, \ 350 struct block_info *blkiov, int blkcnt); } 351186 STD { int lfs_segclean(fsid_t *fsidp, u_long segment); } 352187 STD { int lfs_segwait(fsid_t *fsidp, struct timeval *tv); } 353#else 354184 UNIMPL 355185 UNIMPL 356186 UNIMPL 357187 UNIMPL 358#endif 359188 COMPAT_12 { int sys_stat(const char *path, struct stat12 *ub); } \ 360 stat12 361189 COMPAT_12 { int sys_fstat(int fd, struct stat12 *sb); } fstat12 362190 COMPAT_12 { int sys_lstat(const char *path, \ 363 struct stat12 *ub); } lstat12 364191 STD { long sys_pathconf(const char *path, int name); } 365192 STD { long sys_fpathconf(int fd, int name); } 366193 UNIMPL 367194 STD { int sys_getrlimit(int which, \ 368 struct rlimit *rlp); } 369195 STD { int sys_setrlimit(int which, \ 370 const struct rlimit *rlp); } 371196 COMPAT_12 { int sys_getdirentries(int fd, char *buf, \ 372 u_int count, long *basep); } 373197 STD { void *sys_mmap(void *addr, size_t len, int prot, \ 374 int flags, int fd, long pad, off_t pos); } 375198 INDIR { quad_t sys___syscall(quad_t num, ...); } 376199 STD { off_t sys_lseek(int fd, int pad, off_t offset, \ 377 int whence); } 378200 STD { int sys_truncate(const char *path, int pad, \ 379 off_t length); } 380201 STD { int sys_ftruncate(int fd, int pad, off_t length); } 381202 STD { int sys___sysctl(int *name, u_int namelen, \ 382 void *old, size_t *oldlenp, void *new, \ 383 size_t newlen); } 384203 STD { int sys_mlock(void *addr, size_t len); } 385204 STD { int sys_munlock(void *addr, size_t len); } 386205 STD { int sys_undelete(const char *path); } 387206 STD { int sys_futimes(int fd, \ 388 const struct timeval *tptr); } 389207 STD { int sys_getpgid(pid_t pid); } 390208 STD { int sys_reboot(int opt, char *bootstr); } 391209 STD { int sys_poll(struct pollfd *fds, u_int nfds, \ 392 int timeout); } 393; 394; Syscalls 210-219 are reserved for dynamically loaded syscalls 395; 396#ifdef LKM 397210 NODEF { int sys_lkmnosys(void); } 398211 NODEF { int sys_lkmnosys(void); } 399212 NODEF { int sys_lkmnosys(void); } 400213 NODEF { int sys_lkmnosys(void); } 401214 NODEF { int sys_lkmnosys(void); } 402215 NODEF { int sys_lkmnosys(void); } 403216 NODEF { int sys_lkmnosys(void); } 404217 NODEF { int sys_lkmnosys(void); } 405218 NODEF { int sys_lkmnosys(void); } 406219 NODEF { int sys_lkmnosys(void); } 407#else /* !LKM */ 408210 UNIMPL 409211 UNIMPL 410212 UNIMPL 411213 UNIMPL 412214 UNIMPL 413215 UNIMPL 414216 UNIMPL 415217 UNIMPL 416218 UNIMPL 417219 UNIMPL 418#endif /* !LKM */ 419; System calls 220-300 are reserved for use by NetBSD 420#ifdef SYSVSEM 421220 STD { int sys___semctl(int semid, int semnum, int cmd, \ 422 union semun *arg); } 423221 STD { int sys_semget(key_t key, int nsems, int semflg); } 424222 STD { int sys_semop(int semid, struct sembuf *sops, \ 425 u_int nsops); } 426223 STD { int sys_semconfig(int flag); } 427#else 428220 UNIMPL semctl 429221 UNIMPL semget 430222 UNIMPL semop 431223 UNIMPL semconfig 432#endif 433#ifdef SYSVMSG 434224 STD { int sys_msgctl(int msqid, int cmd, \ 435 struct msqid_ds *buf); } 436225 STD { int sys_msgget(key_t key, int msgflg); } 437226 STD { int sys_msgsnd(int msqid, void *msgp, size_t msgsz, \ 438 int msgflg); } 439227 STD { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \ 440 long msgtyp, int msgflg); } 441#else 442224 UNIMPL msgctl 443225 UNIMPL msgget 444226 UNIMPL msgsnd 445227 UNIMPL msgrcv 446#endif 447#ifdef SYSVSHM 448228 STD { void *sys_shmat(int shmid, void *shmaddr, \ 449 int shmflg); } 450229 STD { int sys_shmctl(int shmid, int cmd, \ 451 struct shmid_ds *buf); } 452230 STD { int sys_shmdt(void *shmaddr); } 453231 STD { int sys_shmget(key_t key, int size, int shmflg); } 454#else 455228 UNIMPL shmat 456229 UNIMPL shmctl 457230 UNIMPL shmdt 458231 UNIMPL shmget 459#endif 460232 STD { int sys_clock_gettime(clockid_t clock_id, \ 461 struct timespec *tp); } 462233 STD { int sys_clock_settime(clockid_t clock_id, \ 463 const struct timespec *tp); } 464234 STD { int sys_clock_getres(clockid_t clock_id, \ 465 struct timespec *tp); } 466235 UNIMPL timer_create 467236 UNIMPL timer_delete 468237 UNIMPL timer_settime 469238 UNIMPL timer_gettime 470239 UNIMPL timer_getoverrun 471; 472; Syscalls 240-269 are reserved for other IEEE Std1003.1b syscalls 473; 474240 STD { int sys_nanosleep(const struct timespec *rqtp, \ 475 struct timespec *rmtp); } 476241 UNIMPL 477242 UNIMPL 478243 UNIMPL 479244 UNIMPL 480245 UNIMPL 481246 UNIMPL 482247 UNIMPL 483248 UNIMPL 484249 UNIMPL 485250 UNIMPL 486251 UNIMPL 487252 UNIMPL 488253 UNIMPL 489254 UNIMPL 490255 UNIMPL 491256 UNIMPL 492257 UNIMPL 493258 UNIMPL 494259 UNIMPL 495260 UNIMPL 496261 UNIMPL 497262 UNIMPL 498263 UNIMPL 499264 UNIMPL 500265 UNIMPL 501266 UNIMPL 502267 UNIMPL 503268 UNIMPL 504269 UNIMPL 505270 STD { int sys_posix_rename(const char *from, \ 506 const char *to); } 507271 STD { int sys_swapctl(int cmd, const void *arg, int misc); } 508272 STD { int sys_getdents(int fd, char *buf, size_t count); } 509273 STD { int sys_minherit(void *addr, size_t len, \ 510 int inherit); } 511274 STD { int sys_lchmod(const char *path, mode_t mode); } 512275 STD { int sys_lchown(const char *path, uid_t uid, \ 513 gid_t gid); } 514276 STD { int sys_lutimes(const char *path, \ 515 const struct timeval *tptr); } 516277 STD { int sys___msync13(void *addr, size_t len, int flags); } 517278 STD { int sys___stat13(const char *path, struct stat *ub); } 518279 STD { int sys___fstat13(int fd, struct stat *sb); } 519280 STD { int sys___lstat13(const char *path, struct stat *ub); } 520281 STD { int sys___sigaltstack14(const struct sigaltstack \ 521 *nss, struct sigaltstack *oss); } 522282 STD { int sys___vfork14(void); } 523