syscalls.master revision 1.59
1 $NetBSD: syscalls.master,v 1.59 1997/10/15 17:27:53 mycroft 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, ... int 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(char *path, int 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, int mode, int dev); } 6615 STD { int sys_chmod(const char *path, int mode); } 6716 STD { int sys_chown(const char *path, uid_t uid, \ 68 gid_t gid); } 6917 STD { int sys_obreak(char *nsize); } break 7018 STD { int sys_getfsstat(struct statfs *buf, long bufsize, \ 71 int flags); } 7219 COMPAT_43 { long sys_lseek(int fd, long offset, int whence); } \ 73 olseek 7420 STD { pid_t sys_getpid(void); } 7521 STD { int sys_mount(const char *type, const char *path, \ 76 int flags, void *data); } 7722 STD { int sys_unmount(const char *path, int flags); } 7823 STD { int sys_setuid(uid_t uid); } 7924 STD { uid_t sys_getuid(void); } 8025 STD { uid_t sys_geteuid(void); } 8126 STD { int sys_ptrace(int req, pid_t pid, caddr_t addr, \ 82 int data); } 8327 STD { ssize_t sys_recvmsg(int s, struct msghdr *msg, \ 84 int flags); } 8528 STD { ssize_t sys_sendmsg(int s, \ 86 const struct msghdr *msg, int flags); } 8729 STD { ssize_t sys_recvfrom(int s, void *buf, size_t len, \ 88 int flags, struct sockaddr *from, \ 89 int *fromlenaddr); } 9030 STD { int sys_accept(int s, struct sockaddr *name, \ 91 int *anamelen); } 9231 STD { int sys_getpeername(int fdes, struct sockaddr *asa, \ 93 int *alen); } 9432 STD { int sys_getsockname(int fdes, struct sockaddr *asa, \ 95 int *alen); } 9633 STD { int sys_access(const char *path, int flags); } 9734 STD { int sys_chflags(const char *path, u_long flags); } 9835 STD { int sys_fchflags(int fd, u_long flags); } 9936 STD { void sys_sync(void); } 10037 STD { int sys_kill(int pid, int signum); } 10138 COMPAT_43 { int sys_stat(char *path, struct ostat *ub); } ostat 10239 STD { pid_t sys_getppid(void); } 10340 COMPAT_43 { int sys_lstat(char *path, struct ostat *ub); } olstat 10441 STD { int sys_dup(int fd); } 10542 STD { int sys_pipe(void); } 10643 STD { gid_t sys_getegid(void); } 10744 STD { int sys_profil(caddr_t samples, size_t size, \ 108 u_long offset, u_int scale); } 109#ifdef KTRACE 11045 STD { int sys_ktrace(const char *fname, int ops, \ 111 int facs, int pid); } 112#else 11345 UNIMPL ktrace 114#endif 11546 STD { int sys_sigaction(int signum, \ 116 const struct sigaction *nsa, \ 117 struct sigaction *osa); } 11847 STD { gid_t sys_getgid(void); } 11948 STD { int sys_sigprocmask(int how, sigset_t mask); } 12049 STD { int sys___getlogin(char *namebuf, u_int namelen); } 12150 STD { int sys_setlogin(const char *namebuf); } 12251 STD { int sys_acct(const char *path); } 12352 STD { int sys_sigpending(void); } 12453 STD { int sys_sigaltstack(const struct sigaltstack *nss, \ 125 struct sigaltstack *oss); } 12654 STD { int sys_ioctl(int fd, \ 127 u_long com, ... caddr_t data); } 12855 COMPAT_12 { int sys_reboot(int opt); } oreboot 12956 STD { int sys_revoke(const char *path); } 13057 STD { int sys_symlink(const char *path, \ 131 const char *link); } 13258 STD { int sys_readlink(const char *path, char *buf, \ 133 int count); } 13459 STD { int sys_execve(const char *path, \ 135 char * const *argp, char * const *envp); } 13660 STD { int sys_umask(int newmask); } 13761 STD { int sys_chroot(const char *path); } 13862 COMPAT_43 { int sys_fstat(int fd, struct ostat *sb); } ofstat 13963 COMPAT_43 { int sys_getkerninfo(int op, char *where, int *size, \ 140 int arg); } ogetkerninfo 14164 COMPAT_43 { int sys_getpagesize(void); } ogetpagesize 14265 STD { int sys_msync(caddr_t addr, size_t len); } 14366 STD { int sys_vfork(void); } 14467 OBSOL vread 14568 OBSOL vwrite 14669 STD { int sys_sbrk(int incr); } 14770 STD { int sys_sstk(int incr); } 14871 COMPAT_43 { int sys_mmap(caddr_t addr, size_t len, int prot, \ 149 int flags, int fd, long pos); } ommap 15072 STD { int sys_ovadvise(int anom); } vadvise 15173 STD { int sys_munmap(caddr_t addr, size_t len); } 15274 STD { int sys_mprotect(caddr_t addr, size_t len, \ 153 int prot); } 15475 STD { int sys_madvise(caddr_t addr, size_t len, \ 155 int behav); } 15676 OBSOL vhangup 15777 OBSOL vlimit 15878 STD { int sys_mincore(caddr_t addr, size_t len, \ 159 char *vec); } 16079 STD { int sys_getgroups(u_int gidsetsize, \ 161 gid_t *gidset); } 16280 STD { int sys_setgroups(u_int gidsetsize, \ 163 const gid_t *gidset); } 16481 STD { int sys_getpgrp(void); } 16582 STD { int sys_setpgid(int pid, int pgid); } 16683 STD { int sys_setitimer(int which, \ 167 const struct itimerval *itv, \ 168 struct itimerval *oitv); } 16984 COMPAT_43 { int sys_wait(void); } owait 17085 COMPAT_12 { int sys_swapon(const char *name); } oswapon 17186 STD { int sys_getitimer(int which, \ 172 struct itimerval *itv); } 17387 COMPAT_43 { int sys_gethostname(char *hostname, u_int len); } \ 174 ogethostname 17588 COMPAT_43 { int sys_sethostname(char *hostname, u_int len); } \ 176 osethostname 17789 COMPAT_43 { int sys_getdtablesize(void); } ogetdtablesize 17890 STD { int sys_dup2(int from, int to); } 17991 UNIMPL getdopt 18092 STD { int sys_fcntl(int fd, int cmd, ... void *arg); } 18193 STD { int sys_select(u_int nd, fd_set *in, fd_set *ou, \ 182 fd_set *ex, struct timeval *tv); } 18394 UNIMPL setdopt 18495 STD { int sys_fsync(int fd); } 18596 STD { int sys_setpriority(int which, int who, int prio); } 18697 STD { int sys_socket(int domain, int type, int protocol); } 18798 STD { int sys_connect(int s, const struct sockaddr *name, \ 188 int namelen); } 18999 COMPAT_43 { int sys_accept(int s, caddr_t name, \ 190 int *anamelen); } oaccept 191100 STD { int sys_getpriority(int which, int who); } 192101 COMPAT_43 { int sys_send(int s, caddr_t buf, int len, \ 193 int flags); } osend 194102 COMPAT_43 { int sys_recv(int s, caddr_t buf, int len, \ 195 int flags); } orecv 196103 STD { int sys_sigreturn(struct sigcontext *sigcntxp); } 197104 STD { int sys_bind(int s, const struct sockaddr *name, \ 198 int namelen); } 199105 STD { int sys_setsockopt(int s, int level, int name, \ 200 const void *val, int valsize); } 201106 STD { int sys_listen(int s, int backlog); } 202107 OBSOL vtimes 203108 COMPAT_43 { int sys_sigvec(int signum, struct sigvec *nsv, \ 204 struct sigvec *osv); } osigvec 205109 COMPAT_43 { int sys_sigblock(int mask); } osigblock 206110 COMPAT_43 { int sys_sigsetmask(int mask); } osigsetmask 207111 STD { int sys_sigsuspend(int mask); } 208112 COMPAT_43 { int sys_sigstack(struct sigstack *nss, \ 209 struct sigstack *oss); } osigstack 210113 COMPAT_43 { int sys_recvmsg(int s, struct omsghdr *msg, \ 211 int flags); } orecvmsg 212114 COMPAT_43 { int sys_sendmsg(int s, caddr_t msg, int flags); } \ 213 osendmsg 214#ifdef TRACE 215115 STD { int sys_vtrace(int request, int value); } 216#else 217115 OBSOL vtrace 218#endif 219116 STD { int sys_gettimeofday(struct timeval *tp, \ 220 struct timezone *tzp); } 221117 STD { int sys_getrusage(int who, struct rusage *rusage); } 222118 STD { int sys_getsockopt(int s, int level, int name, \ 223 void *val, int *avalsize); } 224119 OBSOL resuba 225120 STD { ssize_t sys_readv(int fd, \ 226 const struct iovec *iovp, int iovcnt); } 227121 STD { ssize_t sys_writev(int fd, \ 228 const struct iovec *iovp, int iovcnt); } 229122 STD { int sys_settimeofday(const struct timeval *tv, \ 230 const struct timezone *tzp); } 231123 STD { int sys_fchown(int fd, uid_t uid, gid_t gid); } 232124 STD { int sys_fchmod(int fd, int mode); } 233125 COMPAT_43 { int sys_recvfrom(int s, caddr_t buf, size_t len, \ 234 int flags, caddr_t from, int *fromlenaddr); } \ 235 orecvfrom 236126 STD { int sys_setreuid(uid_t ruid, uid_t euid); } 237127 STD { int sys_setregid(gid_t rgid, gid_t egid); } 238128 STD { int sys_rename(const char *from, const char *to); } 239129 COMPAT_43 { int sys_truncate(char *path, long length); } \ 240 otruncate 241130 COMPAT_43 { int sys_ftruncate(int fd, long length); } oftruncate 242131 STD { int sys_flock(int fd, int how); } 243132 STD { int sys_mkfifo(const char *path, int mode); } 244133 STD { ssize_t sys_sendto(int s, const void *buf, \ 245 size_t len, int flags, const struct sockaddr *to, \ 246 int tolen); } 247134 STD { int sys_shutdown(int s, int how); } 248135 STD { int sys_socketpair(int domain, int type, \ 249 int protocol, int *rsv); } 250136 STD { int sys_mkdir(const char *path, int mode); } 251137 STD { int sys_rmdir(const char *path); } 252138 STD { int sys_utimes(const char *path, \ 253 const struct timeval *tptr); } 254139 OBSOL 4.2 sigreturn 255140 STD { int sys_adjtime(const struct timeval *delta, \ 256 struct timeval *olddelta); } 257141 COMPAT_43 { int sys_getpeername(int fdes, caddr_t asa, \ 258 int *alen); } ogetpeername 259142 COMPAT_43 { int32_t sys_gethostid(void); } ogethostid 260143 COMPAT_43 { int sys_sethostid(int32_t hostid); } osethostid 261144 COMPAT_43 { int sys_getrlimit(int which, \ 262 struct orlimit *rlp); } ogetrlimit 263145 COMPAT_43 { int sys_setrlimit(int which, \ 264 const struct orlimit *rlp); } osetrlimit 265146 COMPAT_43 { int sys_killpg(int pgid, int signum); } okillpg 266147 STD { int sys_setsid(void); } 267148 STD { int sys_quotactl(const char *path, int cmd, \ 268 int uid, caddr_t arg); } 269149 COMPAT_43 { int sys_quota(void); } oquota 270150 COMPAT_43 { int sys_getsockname(int fdec, caddr_t asa, \ 271 int *alen); } ogetsockname 272 273; Syscalls 151-180 inclusive are reserved for vendor-specific 274; system calls. (This includes various calls added for compatibity 275; with other Unix variants.) 276; Some of these calls are now supported by BSD... 277151 UNIMPL 278152 UNIMPL 279153 UNIMPL 280154 UNIMPL 281#if defined(NFS) || defined(NFSSERVER) 282155 STD { int sys_nfssvc(int flag, void *argp); } 283#else 284155 UNIMPL 285#endif 286156 COMPAT_43 { int sys_getdirentries(int fd, char *buf, \ 287 u_int count, long *basep); } ogetdirentries 288157 STD { int sys_statfs(const char *path, \ 289 struct statfs *buf); } 290158 STD { int sys_fstatfs(int fd, struct statfs *buf); } 291159 UNIMPL 292160 UNIMPL 293#if defined(NFS) || defined(NFSSERVER) 294161 STD { int sys_getfh(const char *fname, fhandle_t *fhp); } 295#else 296161 UNIMPL getfh 297#endif 298162 COMPAT_09 { int sys_getdomainname(char *domainname, int len); } \ 299 ogetdomainname 300163 COMPAT_09 { int sys_setdomainname(char *domainname, int len); } \ 301 osetdomainname 302164 COMPAT_09 { int sys_uname(struct outsname *name); } ouname 303165 STD { int sys_sysarch(int op, char *parms); } 304166 UNIMPL 305167 UNIMPL 306168 UNIMPL 307; XXX more generally, never on machines where sizeof(void *) != sizeof(int) 308#if defined(SYSVSEM) && !defined(alpha) 309169 COMPAT_10 { int sys_semsys(int which, int a2, int a3, int a4, \ 310 int a5); } osemsys 311#else 312169 UNIMPL 1.0 semsys 313#endif 314; XXX more generally, never on machines where sizeof(void *) != sizeof(int) 315#if defined(SYSVMSG) && !defined(alpha) 316170 COMPAT_10 { int sys_msgsys(int which, int a2, int a3, int a4, \ 317 int a5, int a6); } omsgsys 318#else 319170 UNIMPL 1.0 msgsys 320#endif 321; XXX more generally, never on machines where sizeof(void *) != sizeof(int) 322#if defined(SYSVSHM) && !defined(alpha) 323171 COMPAT_10 { int sys_shmsys(int which, int a2, int a3, int a4); } \ 324 oshmsys 325#else 326171 UNIMPL 1.0 shmsys 327#endif 328172 UNIMPL 329173 UNIMPL 330174 UNIMPL 331175 STD { int sys_ntp_gettime(struct ntptimeval *ntvp); } 332176 STD { int sys_ntp_adjtime(struct timex *tp); } 333177 UNIMPL 334178 UNIMPL 335179 UNIMPL 336180 UNIMPL 337 338; Syscalls 180-199 are used by/reserved for BSD 339181 STD { int sys_setgid(gid_t gid); } 340182 STD { int sys_setegid(gid_t egid); } 341183 STD { int sys_seteuid(uid_t euid); } 342#ifdef LFS 343184 STD { int lfs_bmapv(fsid_t *fsidp, \ 344 struct block_info *blkiov, int blkcnt); } 345185 STD { int lfs_markv(fsid_t *fsidp, \ 346 struct block_info *blkiov, int blkcnt); } 347186 STD { int lfs_segclean(fsid_t *fsidp, u_long segment); } 348187 STD { int lfs_segwait(fsid_t *fsidp, struct timeval *tv); } 349#else 350184 UNIMPL 351185 UNIMPL 352186 UNIMPL 353187 UNIMPL 354#endif 355188 STD { int sys_stat(const char *path, struct stat *ub); } 356189 STD { int sys_fstat(int fd, struct stat *sb); } 357190 STD { int sys_lstat(const char *path, struct stat *ub); } 358191 STD { long sys_pathconf(const char *path, int name); } 359192 STD { long sys_fpathconf(int fd, int name); } 360193 UNIMPL 361194 STD { int sys_getrlimit(int which, \ 362 struct rlimit *rlp); } 363195 STD { int sys_setrlimit(int which, \ 364 const struct rlimit *rlp); } 365196 COMPAT_12 { int sys_getdirentries(int fd, char *buf, \ 366 u_int count, long *basep); } 367197 STD { caddr_t sys_mmap(caddr_t addr, size_t len, int prot, \ 368 int flags, int fd, long pad, off_t pos); } 369198 INDIR { quad_t sys___syscall(quad_t num, ...); } 370199 STD { off_t sys_lseek(int fd, int pad, off_t offset, \ 371 int whence); } 372200 STD { int sys_truncate(const char *path, int pad, \ 373 off_t length); } 374201 STD { int sys_ftruncate(int fd, int pad, off_t length); } 375202 STD { int sys___sysctl(int *name, u_int namelen, \ 376 void *old, size_t *oldlenp, void *new, \ 377 size_t newlen); } 378203 STD { int sys_mlock(caddr_t addr, size_t len); } 379204 STD { int sys_munlock(caddr_t addr, size_t len); } 380205 STD { int sys_undelete(const char *path); } 381206 STD { int sys_futimes(int fd, \ 382 const struct timeval *tptr); } 383207 STD { int sys_getpgid(pid_t pid); } 384208 STD { int sys_reboot(int opt, char *bootstr); } 385209 STD { int sys_poll(struct pollfd *fds, u_int nfds, \ 386 int timeout); } 387; 388; Syscalls 210-219 are reserved for dynamically loaded syscalls 389; 390#ifdef LKM 391210 NODEF { int sys_lkmnosys(void); } 392211 NODEF { int sys_lkmnosys(void); } 393212 NODEF { int sys_lkmnosys(void); } 394213 NODEF { int sys_lkmnosys(void); } 395214 NODEF { int sys_lkmnosys(void); } 396215 NODEF { int sys_lkmnosys(void); } 397216 NODEF { int sys_lkmnosys(void); } 398217 NODEF { int sys_lkmnosys(void); } 399218 NODEF { int sys_lkmnosys(void); } 400219 NODEF { int sys_lkmnosys(void); } 401#else /* !LKM */ 402210 UNIMPL 403211 UNIMPL 404212 UNIMPL 405213 UNIMPL 406214 UNIMPL 407215 UNIMPL 408216 UNIMPL 409217 UNIMPL 410218 UNIMPL 411219 UNIMPL 412#endif /* !LKM */ 413; System calls 220-300 are reserved for use by NetBSD 414#ifdef SYSVSEM 415220 STD { int sys___semctl(int semid, int semnum, int cmd, \ 416 union semun *arg); } 417221 STD { int sys_semget(key_t key, int nsems, int semflg); } 418222 STD { int sys_semop(int semid, struct sembuf *sops, \ 419 u_int nsops); } 420223 STD { int sys_semconfig(int flag); } 421#else 422220 UNIMPL semctl 423221 UNIMPL semget 424222 UNIMPL semop 425223 UNIMPL semconfig 426#endif 427#ifdef SYSVMSG 428224 STD { int sys_msgctl(int msqid, int cmd, \ 429 struct msqid_ds *buf); } 430225 STD { int sys_msgget(key_t key, int msgflg); } 431226 STD { int sys_msgsnd(int msqid, void *msgp, size_t msgsz, \ 432 int msgflg); } 433227 STD { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \ 434 long msgtyp, int msgflg); } 435#else 436224 UNIMPL msgctl 437225 UNIMPL msgget 438226 UNIMPL msgsnd 439227 UNIMPL msgrcv 440#endif 441#ifdef SYSVSHM 442228 STD { void *sys_shmat(int shmid, void *shmaddr, \ 443 int shmflg); } 444229 STD { int sys_shmctl(int shmid, int cmd, \ 445 struct shmid_ds *buf); } 446230 STD { int sys_shmdt(void *shmaddr); } 447231 STD { int sys_shmget(key_t key, int size, int shmflg); } 448#else 449228 UNIMPL shmat 450229 UNIMPL shmctl 451230 UNIMPL shmdt 452231 UNIMPL shmget 453#endif 454232 STD { int sys_clock_gettime(clockid_t clock_id, \ 455 struct timespec *tp); } 456233 STD { int sys_clock_settime(clockid_t clock_id, \ 457 const struct timespec *tp); } 458234 STD { int sys_clock_getres(clockid_t clock_id, \ 459 struct timespec *tp); } 460235 UNIMPL timer_create 461236 UNIMPL timer_delete 462237 UNIMPL timer_settime 463238 UNIMPL timer_gettime 464239 UNIMPL timer_getoverrun 465; 466; Syscalls 240-269 are reserved for other IEEE Std1003.1b syscalls 467; 468240 STD { int sys_nanosleep(const struct timespec *rqtp, \ 469 struct timespec *rmtp); } 470241 UNIMPL 471242 UNIMPL 472243 UNIMPL 473244 UNIMPL 474245 UNIMPL 475246 UNIMPL 476247 UNIMPL 477248 UNIMPL 478249 UNIMPL 479250 UNIMPL 480251 UNIMPL 481252 UNIMPL 482253 UNIMPL 483254 UNIMPL 484255 UNIMPL 485256 UNIMPL 486257 UNIMPL 487258 UNIMPL 488259 UNIMPL 489260 UNIMPL 490261 UNIMPL 491262 UNIMPL 492263 UNIMPL 493264 UNIMPL 494265 UNIMPL 495266 UNIMPL 496267 UNIMPL 497268 UNIMPL 498269 UNIMPL 499270 STD { int sys_posix_rename(const char *from, \ 500 const char *to); } 501271 STD { int sys_swapctl(int cmd, void *arg, int misc); } 502272 STD { int sys_getdents(int fd, char *buf, size_t count); } 503273 STD { int sys_minherit(caddr_t addr, size_t len, \ 504 int inherit); } 505274 STD { int sys_lchmod(const char *path, int mode); } 506275 STD { int sys_lchown(const char *path, uid_t uid, \ 507 gid_t gid); } 508276 STD { int sys_lutimes(const char *path, \ 509 const struct timeval *tptr); } 510