syscalls.master revision 13331
11590Srgrimes $Id: syscalls.master,v 1.22 1996/01/04 20:28:48 wollman Exp $ 21590Srgrimes; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 31590Srgrimes; 41590Srgrimes; System call name/number master file. 51590Srgrimes; Processed to created init_sysent.c, syscalls.c and syscall.h. 61590Srgrimes 71590Srgrimes; Columns: number type nargs namespc name alt{name,tag,rtyp}/comments 81590Srgrimes; number system call number, must be in order 91590Srgrimes; type one of STD, OBSOL, UNIMPL, COMPAT 101590Srgrimes; namespc one of POSIX, BSD, NOHIDE 111590Srgrimes; name psuedo-prototype of syscall routine 121590Srgrimes; If one of the following alts is different, then all appear: 131590Srgrimes; altname name of system call if different 141590Srgrimes; alttag name of args struct tag if different from [o]`name'"_args" 151590Srgrimes; altrtyp return type if not int (bogus - syscalls always return int) 161590Srgrimes; for UNIMPL/OBSOL, name continues with comments 171590Srgrimes 181590Srgrimes; types: 191590Srgrimes; STD always included 201590Srgrimes; COMPAT included on COMPAT #ifdef 211590Srgrimes; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h 221590Srgrimes; OBSOL obsolete, not included in system, only specifies name 231590Srgrimes; UNIMPL not implemented, placeholder only 241590Srgrimes 251590Srgrimes; #ifdef's, etc. may be included, and are copied to the output files. 261590Srgrimes 271590Srgrimes#include "opt_sysvipc.h" 281590Srgrimes#include <sys/types.h> 291590Srgrimes#include <sys/param.h> 301590Srgrimes#include <sys/mount.h> 311590Srgrimes#include <sys/sysent.h> 321590Srgrimes#include <sys/sysproto.h> 331590Srgrimes 341590Srgrimes; Reserved/unimplemented system calls in the range 0-150 inclusive 351590Srgrimes; are reserved for use in future Berkeley releases. 361590Srgrimes; Additional system calls implemented in vendor and other 371590Srgrimes; redistributions should be placed in the reserved range at the end 381590Srgrimes; of the current calls. 391590Srgrimes 401590Srgrimes0 STD NOHIDE { int nosys(void); } syscall nosys_args int 411590Srgrimes1 STD NOHIDE { void exit(int rval); } exit rexit_args void 421590Srgrimes2 STD POSIX { int fork(void); } 431590Srgrimes3 STD POSIX { int read(int fd, char *buf, u_int nbyte); } 441590Srgrimes4 STD POSIX { int write(int fd, char *buf, u_int nbyte); } 451590Srgrimes5 STD POSIX { int open(char *path, int flags, int mode); } 461590Srgrimes; XXX should be { int open(const char *path, int flags, ...); } 471590Srgrimes; but we're not ready for `const' or varargs. 481590Srgrimes; XXX man page says `mode_t mode'. 491590Srgrimes6 STD POSIX { int close(int fd); } 501590Srgrimes7 STD BSD { int wait4(int pid, int *status, int options, \ 511590Srgrimes struct rusage *rusage); } wait4 wait_args int 521590Srgrimes8 COMPAT BSD { int creat(char *path, int mode); } 531590Srgrimes9 STD POSIX { int link(char *path, char *link); } 541590Srgrimes10 STD POSIX { int unlink(char *path); } 551590Srgrimes11 OBSOL NOHIDE execv 561590Srgrimes12 STD POSIX { int chdir(char *path); } 571590Srgrimes13 STD BSD { int fchdir(int fd); } 581590Srgrimes14 STD POSIX { int mknod(char *path, int mode, int dev); } 592537Spst15 STD POSIX { int chmod(char *path, int mode); } 601590Srgrimes16 STD POSIX { int chown(char *path, int uid, int gid); } 611590Srgrimes17 STD BSD { int obreak(char *nsize); } break obreak_args int 6211386Speter18 STD BSD { int getfsstat(struct statfs *buf, long bufsize, \ 639993Sache int flags); } 641590Srgrimes19 COMPAT POSIX { long lseek(int fd, long offset, int whence); } 651590Srgrimes20 STD POSIX { pid_t getpid(void); } 661590Srgrimes21 STD BSD { int mount(int type, char *path, int flags, \ 671590Srgrimes caddr_t data); } 681590Srgrimes; XXX 4.4lite2 uses `char *type' but we're not ready for that. 691590Srgrimes; XXX `path' should have type `const char *' but we're not ready for that. 701590Srgrimes22 STD BSD { int unmount(char *path, int flags); } 711590Srgrimes23 STD POSIX { int setuid(uid_t uid); } 721590Srgrimes24 STD POSIX { uid_t getuid(void); } 731590Srgrimes25 STD POSIX { uid_t geteuid(void); } 742537Spst26 STD BSD { int ptrace(int req, pid_t pid, caddr_t addr, \ 752537Spst int data); } 762537Spst27 STD BSD { int recvmsg(int s, struct msghdr *msg, int flags); } 772537Spst28 STD BSD { int sendmsg(int s, caddr_t msg, int flags); } 782537Spst29 STD BSD { int recvfrom(int s, caddr_t buf, size_t len, \ 792537Spst int flags, caddr_t from, int *fromlenaddr); } 802537Spst30 STD BSD { int accept(int s, caddr_t name, int *anamelen); } 811590Srgrimes31 STD BSD { int getpeername(int fdes, caddr_t asa, int *alen); } 821590Srgrimes32 STD BSD { int getsockname(int fdes, caddr_t asa, int *alen); } 8311386Speter33 STD POSIX { int access(char *path, int flags); } 8411386Speter34 STD BSD { int chflags(char *path, int flags); } 8511386Speter35 STD BSD { int fchflags(int fd, int flags); } 862537Spst36 STD BSD { int sync(void); } 871590Srgrimes37 STD POSIX { int kill(int pid, int signum); } 881590Srgrimes38 COMPAT POSIX { int stat(char *path, struct ostat *ub); } 891590Srgrimes39 STD POSIX { pid_t getppid(void); } 901590Srgrimes40 COMPAT POSIX { int lstat(char *path, struct ostat *ub); } 911590Srgrimes41 STD POSIX { int dup(u_int fd); } 921590Srgrimes42 STD POSIX { int pipe(void); } 931590Srgrimes43 STD POSIX { gid_t getegid(void); } 941590Srgrimes44 STD BSD { int profil(caddr_t samples, u_int size, \ 951590Srgrimes u_int offset, u_int scale); } 961590Srgrimes45 STD BSD { int ktrace(char *fname, int ops, int facs, \ 9711386Speter int pid); } 9811386Speter46 STD POSIX { int sigaction(int signum, struct sigaction *nsa, \ 9911386Speter struct sigaction *osa); } 10011386Speter47 STD POSIX { gid_t getgid(void); } 10111386Speter48 STD POSIX { int sigprocmask(int how, sigset_t mask); } 10211386Speter49 STD BSD { int getlogin(char *namebuf, u_int namelen); } 1031590Srgrimes50 STD BSD { int setlogin(char *namebuf); } 1041590Srgrimes51 STD BSD { int acct(char *path); } 1051590Srgrimes52 STD POSIX { int sigpending(void); } 1061590Srgrimes53 STD BSD { int sigaltstack(struct sigaltstack *nss, \ 1071590Srgrimes struct sigaltstack *oss); } 1081590Srgrimes54 STD POSIX { int ioctl(int fd, u_long com, caddr_t data); } 1091590Srgrimes55 STD BSD { int reboot(int opt); } 11010553Speter56 STD POSIX { int revoke(char *path); } 1117371Sjoerg57 STD POSIX { int symlink(char *path, char *link); } 1127371Sjoerg58 STD POSIX { int readlink(char *path, char *buf, int count); } 1137371Sjoerg59 STD POSIX { int execve(char *fname, char **argv, char **envv); } 1141590Srgrimes60 STD POSIX { int umask(int newmask); } umask umask_args mode_t 11510553Speter61 STD BSD { int chroot(char *path); } 1161590Srgrimes62 COMPAT POSIX { int fstat(int fd, struct ostat *sb); } 1171590Srgrimes63 COMPAT BSD { int getkerninfo(int op, char *where, int *size, \ 1181590Srgrimes int arg); } getkerninfo getkerninfo_args int 1191590Srgrimes64 COMPAT BSD { int getpagesize(void); } \ 1201590Srgrimes getpagesize getpagesize_args int 1219993Sache65 STD BSD { int msync(caddr_t addr, int len, int flags); } 1229987Swollman; XXX should be { int msync(caddr_t addr, size_t len, int flags); } 1239987Swollman; but man page and old args struct have `int len'. 1249987Swollman66 NOARGS BSD { int vfork(void); } vfork fork_args int 1252537Spst67 OBSOL NOHIDE vread 1262537Spst68 OBSOL NOHIDE vwrite 1272537Spst69 STD BSD { int sbrk(int incr); } 1282537Spst70 STD BSD { int sstk(int incr); } 1291590Srgrimes71 COMPAT BSD { int mmap(caddr_t addr, int len, int prot, \ 1301590Srgrimes int flags, int fd, long pos); } 1311590Srgrimes; XXX should be { int mmap(caddr_t addr, size_t len, int prot, 1321590Srgrimes; int flags, int fd, long pos); } 1332537Spst; but old args struct has `int len'. 1342537Spst72 STD BSD { int ovadvise(int anom); } vadvise ovadvise_args int 1351590Srgrimes73 STD BSD { int munmap(caddr_t addr, int len); } 1361590Srgrimes; XXX should be { int munmap(caddr_t addr, size_t len); } 1371590Srgrimes; but man page and old args struct have `int len'. 1381590Srgrimes74 STD BSD { int mprotect(caddr_t addr, int len, int prot); } 13911386Speter; XXX should be { int mprotect(caddr_t addr, size_t len, int prot); } 1401590Srgrimes; but man page and old args struct have `int len'. 1412537Spst75 STD BSD { int madvise(caddr_t addr, int len, int behav); } 1422537Spst; XXX should be { int madvise(caddr_t addr, size_t len, int behav); } 1431590Srgrimes; but man page, madvise() prototype and old args struct have `int len'. 1441590Srgrimes76 OBSOL NOHIDE vhangup 1451590Srgrimes77 OBSOL NOHIDE vlimit 1461590Srgrimes78 STD BSD { int mincore(caddr_t addr, int len, char *vec); } 1471590Srgrimes; XXX should be { int mincore(caddr_t addr, size_t len, char *vec); } 1481590Srgrimes; but man page, and old args struct have `int len'. 1491590Srgrimes; XXX mincore() prototype isn't in <sys/mman.h>. 1501590Srgrimes79 STD POSIX { int getgroups(u_int gidsetsize, gid_t *gidset); } 1511590Srgrimes80 STD POSIX { int setgroups(u_int gidsetsize, gid_t *gidset); } 1521590Srgrimes81 STD POSIX { int getpgrp(void); } 1531590Srgrimes82 STD POSIX { int setpgid(int pid, int pgid); } 1541590Srgrimes83 STD BSD { int setitimer(u_int which, struct itimerval *itv, \ 1551590Srgrimes struct itimerval *oitv); } 1561590Srgrimes84 COMPAT BSD { int wait(void); } 1571590Srgrimes85 STD BSD { int swapon(char *name); } 1581590Srgrimes86 STD BSD { int getitimer(u_int which, struct itimerval *itv); } 1591590Srgrimes87 COMPAT BSD { int gethostname(char *hostname, u_int len); } \ 1601590Srgrimes gethostname gethostname_args int 1611590Srgrimes88 COMPAT BSD { int sethostname(char *hostname, u_int len); } \ 1621590Srgrimes sethostname sethostname_args int 1631590Srgrimes89 STD BSD { int getdtablesize(void); } 1641590Srgrimes90 STD POSIX { int dup2(u_int from, u_int to); } 1651590Srgrimes91 UNIMPL BSD getdopt 1661590Srgrimes92 STD POSIX { int fcntl(int fd, int cmd, int arg); } 167; XXX should be { int fcntl(int fd, int cmd, ...); } 168; but we're not ready for varargs. 169; XXX man page says `int arg' too. 17093 STD BSD { int select(u_int nd, fd_set *in, fd_set *ou, \ 171 fd_set *ex, struct timeval *tv); } 17294 UNIMPL BSD setdopt 17395 STD POSIX { int fsync(int fd); } 17496 STD BSD { int setpriority(int which, int who, int prio); } 17597 STD BSD { int socket(int domain, int type, int protocol); } 17698 STD BSD { int connect(int s, caddr_t name, int namelen); } 17799 CPT_NOA BSD { int accept(int s, caddr_t name, int *anamelen); } \ 178 accept accept_args int 179100 STD BSD { int getpriority(int which, int who); } 180101 COMPAT BSD { int send(int s, caddr_t buf, int len, int flags); } 181102 COMPAT BSD { int recv(int s, caddr_t buf, int len, int flags); } 182103 STD BSD { int sigreturn(struct sigcontext *sigcntxp); } 183104 STD BSD { int bind(int s, caddr_t name, int namelen); } 184105 STD BSD { int setsockopt(int s, int level, int name, \ 185 caddr_t val, int valsize); } 186106 STD BSD { int listen(int s, int backlog); } 187107 OBSOL NOHIDE vtimes 188108 COMPAT BSD { int sigvec(int signum, struct sigvec *nsv, \ 189 struct sigvec *osv); } 190109 COMPAT BSD { int sigblock(int mask); } 191110 COMPAT BSD { int sigsetmask(int mask); } 192111 STD POSIX { int sigsuspend(int mask); } 193112 COMPAT BSD { int sigstack(struct sigstack *nss, \ 194 struct sigstack *oss); } 195113 COMPAT BSD { int recvmsg(int s, struct omsghdr *msg, int flags); } 196114 COMPAT BSD { int sendmsg(int s, caddr_t msg, int flags); } 197115 OBSOL NOHIDE vtrace 198116 STD BSD { int gettimeofday(struct timeval *tp, \ 199 struct timezone *tzp); } 200117 STD BSD { int getrusage(int who, struct rusage *rusage); } 201118 STD BSD { int getsockopt(int s, int level, int name, \ 202 caddr_t val, int *avalsize); } 203119 UNIMPL NOHIDE nosys 204120 STD BSD { int readv(int fd, struct iovec *iovp, u_int iovcnt); } 205121 STD BSD { int writev(int fd, struct iovec *iovp, \ 206 u_int iovcnt); } 207122 STD BSD { int settimeofday(struct timeval *tv, \ 208 struct timezone *tzp); } 209123 STD BSD { int fchown(int fd, int uid, int gid); } 210124 STD BSD { int fchmod(int fd, int mode); } 211125 CPT_NOA BSD { int recvfrom(int s, caddr_t buf, size_t len, \ 212 int flags, caddr_t from, int *fromlenaddr); } \ 213 recvfrom recvfrom_args int 214126 STD BSD { int setreuid(int ruid, int euid); } 215127 STD BSD { int setregid(int rgid, int egid); } 216128 STD POSIX { int rename(char *from, char *to); } 217129 COMPAT BSD { int truncate(char *path, long length); } 218130 COMPAT BSD { int ftruncate(int fd, long length); } 219131 STD BSD { int flock(int fd, int how); } 220132 STD POSIX { int mkfifo(char *path, int mode); } 221133 STD BSD { int sendto(int s, caddr_t buf, size_t len, \ 222 int flags, caddr_t to, int tolen); } 223134 STD BSD { int shutdown(int s, int how); } 224135 STD BSD { int socketpair(int domain, int type, int protocol, \ 225 int *rsv); } 226136 STD POSIX { int mkdir(char *path, int mode); } 227137 STD POSIX { int rmdir(char *path); } 228138 STD BSD { int utimes(char *path, struct timeval *tptr); } 229139 OBSOL NOHIDE 4.2 sigreturn 230140 STD BSD { int adjtime(struct timeval *delta, \ 231 struct timeval *olddelta); } 232141 COMPAT BSD { int getpeername(int fdes, caddr_t asa, int *alen); } 233142 COMPAT BSD { long gethostid(void); } 234143 COMPAT BSD { int sethostid(long hostid); } 235144 COMPAT BSD { int getrlimit(u_int which, struct ogetrlimit *rlp); } 236145 COMPAT BSD { int setrlimit(u_int which, struct ogetrlimit *rlp); } 237146 COMPAT BSD { int killpg(int pgid, int signum); } 238147 STD POSIX { int setsid(void); } 239148 STD BSD { int quotactl(char *path, int cmd, int uid, \ 240 caddr_t arg); } 241149 COMPAT BSD { int quota(void); } 242150 CPT_NOA BSD { int getsockname(int fdec, caddr_t asa, int *alen); }\ 243 getsockname getsockname_args int 244 245; Syscalls 151-180 inclusive are reserved for vendor-specific 246; system calls. (This includes various calls added for compatibity 247; with other Unix variants.) 248; Some of these calls are now supported by BSD... 249151 UNIMPL NOHIDE nosys 250152 UNIMPL NOHIDE nosys 251153 UNIMPL NOHIDE nosys 252154 UNIMPL NOHIDE nosys 253#ifdef NFS 254155 STD BSD { int nfssvc(int flag, caddr_t argp); } 255#else 256155 UNIMPL BSD nosys 257#endif 258156 COMPAT BSD { int getdirentries(int fd, char *buf, u_int count, \ 259 long *basep); } 260157 STD BSD { int statfs(char *path, struct statfs *buf); } 261158 STD BSD { int fstatfs(int fd, struct statfs *buf); } 262159 UNIMPL NOHIDE nosys 263160 UNIMPL NOHIDE nosys 264#ifdef NFS 265161 STD BSD { int getfh(char *fname, fhandle_t *fhp); } 266#else 267161 UNIMPL BSD nosys 268#endif 269162 STD BSD { int getdomainname(char *domainname, int len); } 270163 STD BSD { int setdomainname(char *domainname, int len); } 271164 STD BSD { int uname(struct utsname *name); } 272165 STD BSD { int sysarch(int op, char *parms); } 273166 STD BSD { int rtprio(int function, pid_t pid, \ 274 struct rtprio *rtp); } 275167 UNIMPL NOHIDE nosys 276168 UNIMPL NOHIDE nosys 277169 STD BSD { int semsys(int which, int a2, int a3, int a4, \ 278 int a5); } 279; XXX should be { int semsys(int which, ...); } 280170 STD BSD { int msgsys(int which, int a2, int a3, int a4, \ 281 int a5, int a6); } 282; XXX should be { int msgsys(int which, ...); } 283171 STD BSD { int shmsys(int which, int a2, int a3, int a4); } 284; XXX should be { int shmsys(int which, ...); } 285172 UNIMPL NOHIDE nosys 286173 UNIMPL NOHIDE nosys 287174 UNIMPL NOHIDE nosys 288175 UNIMPL NOHIDE nosys 289176 STD BSD { int ntp_adjtime(struct timex *tp); } 290177 UNIMPL NOHIDE nosys 291178 UNIMPL NOHIDE nosys 292179 UNIMPL NOHIDE nosys 293180 UNIMPL NOHIDE nosys 294 295; Syscalls 180-199 are used by/reserved for BSD 296181 STD POSIX { int setgid(gid_t gid); } 297182 STD BSD { int setegid(gid_t egid); } 298183 STD BSD { int seteuid(uid_t euid); } 299#ifdef LFS 300184 STD BSD { int lfs_bmapv(fsid_t *fsidp, \ 301 struct block_info *blkiov, int blkcnt); } 302185 STD BSD { int lfs_markv(fsid_t *fsidp, \ 303 struct block_info *blkiov, int blkcnt); } 304186 STD BSD { int lfs_segclean(fsid_t *fsidp, u_long segment); } 305187 STD BSD { int lfs_segwait(fsid_t *fsidp, struct timeval *tv); } 306#else 307184 UNIMPL BSD nosys 308185 UNIMPL BSD nosys 309186 UNIMPL BSD nosys 310187 UNIMPL BSD nosys 311#endif 312188 STD POSIX { int stat(char *path, struct stat *ub); } 313189 STD POSIX { int fstat(int fd, struct stat *sb); } 314190 STD POSIX { int lstat(char *path, struct stat *ub); } 315191 STD POSIX { int pathconf(char *path, int name); } 316192 STD POSIX { int fpathconf(int fd, int name); } 317193 UNIMPL NOHIDE nosys 318194 STD BSD { int getrlimit(u_int which, \ 319 struct orlimit *rlp); } \ 320 getrlimit __getrlimit_args int 321195 STD BSD { int setrlimit(u_int which, \ 322 struct orlimit *rlp); } \ 323 setrlimit __setrlimit_args int 324196 STD BSD { int getdirentries(int fd, char *buf, u_int count, \ 325 long *basep); } 326197 STD BSD { caddr_t mmap(caddr_t addr, size_t len, int prot, \ 327 int flags, int fd, long pad, off_t pos); } 328198 STD NOHIDE { int nosys(void); } __syscall __syscall_args int 329199 STD POSIX { off_t lseek(int fd, int pad, off_t offset, \ 330 int whence); } 331200 STD BSD { int truncate(char *path, int pad, off_t length); } 332201 STD BSD { int ftruncate(int fd, int pad, off_t length); } 333202 STD BSD { int __sysctl(int *name, u_int namelen, void *old, \ 334 size_t *oldlenp, void *new, size_t newlen); } \ 335 __sysctl sysctl_args int 336; properly, __sysctl should be a NOHIDE, but making an exception 337; here allows to avoid one in libc/sys/Makefile.inc. 338203 STD BSD { int mlock(caddr_t addr, size_t len); } 339204 STD BSD { int munlock(caddr_t addr, size_t len); } 340205 UNIMPL NOHIDE nosys 341206 UNIMPL NOHIDE nosys 342207 UNIMPL NOHIDE nosys 343208 UNIMPL NOHIDE nosys 344209 UNIMPL NOHIDE nosys 345 346; 347; The following are reserved for loadable syscalls 348; 349210 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 350211 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 351212 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 352213 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 353214 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 354215 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 355216 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 356217 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 357218 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 358219 NODEF NOHIDE lkmnosys lkmnosys nosys_args int 359 360; 361; The following were originally used in NetBSD. 362; 363220 STD BSD { int __semctl(int semid, int semnum, int cmd, \ 364 union semun *arg); } 365221 STD BSD { int semget(key_t key, int nsems, int semflg); } 366222 STD BSD { int semop(int semid, struct sembuf *sops, \ 367 u_int nsops); } 368223 STD BSD { int semconfig(int flag); } 369224 STD BSD { int msgctl(int msqid, int cmd, \ 370 struct msqid_ds *buf); } 371225 STD BSD { int msgget(key_t key, int msgflg); } 372226 STD BSD { int msgsnd(int msqid, void *msgp, size_t msgsz, \ 373 int msgflg); } 374227 STD BSD { int msgrcv(int msqid, void *msgp, size_t msgsz, \ 375 long msgtyp, int msgflg); } 376228 STD BSD { int shmat(int shmid, void *shmaddr, int shmflg); } 377229 STD BSD { int shmctl(int shmid, int cmd, \ 378 struct shmid_ds *buf); } 379230 STD BSD { int shmdt(void *shmaddr); } 380231 STD BSD { int shmget(key_t key, int size, int shmflg); } 381