syscalls.master revision 13331
1	$Id: syscalls.master,v 1.22 1996/01/04 20:28:48 wollman Exp $
2;	from: @(#)syscalls.master	8.2 (Berkeley) 1/13/94
3;
4; System call name/number master file.
5; Processed to created init_sysent.c, syscalls.c and syscall.h.
6
7; Columns: number type nargs namespc name alt{name,tag,rtyp}/comments
8;	number	system call number, must be in order
9;	type	one of STD, OBSOL, UNIMPL, COMPAT
10;	namespc one of POSIX, BSD, NOHIDE
11;	name	psuedo-prototype of syscall routine
12;		If one of the following alts is different, then all appear:
13;	altname	name of system call if different
14;	alttag	name of args struct tag if different from [o]`name'"_args"
15;	altrtyp	return type if not int (bogus - syscalls always return int)
16;		for UNIMPL/OBSOL, name continues with comments
17
18; types:
19;	STD	always included
20;	COMPAT	included on COMPAT #ifdef
21;	LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h
22;	OBSOL	obsolete, not included in system, only specifies name
23;	UNIMPL	not implemented, placeholder only
24
25; #ifdef's, etc. may be included, and are copied to the output files.
26
27#include "opt_sysvipc.h"
28#include <sys/types.h>
29#include <sys/param.h>
30#include <sys/mount.h>
31#include <sys/sysent.h>
32#include <sys/sysproto.h>
33
34; Reserved/unimplemented system calls in the range 0-150 inclusive
35; are reserved for use in future Berkeley releases.
36; Additional system calls implemented in vendor and other
37; redistributions should be placed in the reserved range at the end
38; of the current calls.
39
400	STD	NOHIDE	{ int nosys(void); } syscall nosys_args int
411	STD	NOHIDE	{ void exit(int rval); } exit rexit_args void
422	STD	POSIX	{ int fork(void); }
433	STD	POSIX	{ int read(int fd, char *buf, u_int nbyte); }
444	STD	POSIX	{ int write(int fd, char *buf, u_int nbyte); }
455	STD	POSIX	{ int open(char *path, int flags, int mode); }
46; XXX should be		{ int open(const char *path, int flags, ...); }
47; but we're not ready for `const' or varargs.
48; XXX man page says `mode_t mode'.
496	STD	POSIX	{ int close(int fd); }
507	STD	BSD	{ int wait4(int pid, int *status, int options, \
51			    struct rusage *rusage); } wait4 wait_args int
528	COMPAT	BSD	{ int creat(char *path, int mode); }
539	STD	POSIX	{ int link(char *path, char *link); }
5410	STD	POSIX	{ int unlink(char *path); }
5511	OBSOL	NOHIDE	execv
5612	STD	POSIX	{ int chdir(char *path); }
5713	STD	BSD	{ int fchdir(int fd); }
5814	STD	POSIX	{ int mknod(char *path, int mode, int dev); }
5915	STD	POSIX	{ int chmod(char *path, int mode); }
6016	STD	POSIX	{ int chown(char *path, int uid, int gid); }
6117	STD	BSD	{ int obreak(char *nsize); } break obreak_args int
6218	STD	BSD	{ int getfsstat(struct statfs *buf, long bufsize, \
63			    int flags); }
6419	COMPAT	POSIX	{ long lseek(int fd, long offset, int whence); }
6520	STD	POSIX	{ pid_t getpid(void); }
6621	STD	BSD	{ int mount(int type, char *path, int flags, \
67			    caddr_t data); }
68; XXX 4.4lite2 uses `char *type' but we're not ready for that.
69; XXX `path' should have type `const char *' but we're not ready for that.
7022	STD	BSD	{ int unmount(char *path, int flags); }
7123	STD	POSIX	{ int setuid(uid_t uid); }
7224	STD	POSIX	{ uid_t getuid(void); }
7325	STD	POSIX	{ uid_t geteuid(void); }
7426	STD	BSD	{ int ptrace(int req, pid_t pid, caddr_t addr, \
75			    int data); }
7627	STD	BSD	{ int recvmsg(int s, struct msghdr *msg, int flags); }
7728	STD	BSD	{ int sendmsg(int s, caddr_t msg, int flags); }
7829	STD	BSD	{ int recvfrom(int s, caddr_t buf, size_t len, \
79			    int flags, caddr_t from, int *fromlenaddr); }
8030	STD	BSD	{ int accept(int s, caddr_t name, int *anamelen); }
8131	STD	BSD	{ int getpeername(int fdes, caddr_t asa, int *alen); }
8232	STD	BSD	{ int getsockname(int fdes, caddr_t asa, int *alen); }
8333	STD	POSIX	{ int access(char *path, int flags); }
8434	STD	BSD	{ int chflags(char *path, int flags); }
8535	STD	BSD	{ int fchflags(int fd, int flags); }
8636	STD	BSD	{ int sync(void); }
8737	STD	POSIX	{ int kill(int pid, int signum); }
8838	COMPAT	POSIX	{ int stat(char *path, struct ostat *ub); }
8939	STD	POSIX	{ pid_t getppid(void); }
9040	COMPAT	POSIX	{ int lstat(char *path, struct ostat *ub); }
9141	STD	POSIX	{ int dup(u_int fd); }
9242	STD	POSIX	{ int pipe(void); }
9343	STD	POSIX	{ gid_t getegid(void); }
9444	STD	BSD	{ int profil(caddr_t samples, u_int size, \
95			    u_int offset, u_int scale); }
9645	STD	BSD	{ int ktrace(char *fname, int ops, int facs, \
97			    int pid); }
9846	STD	POSIX	{ int sigaction(int signum, struct sigaction *nsa, \
99			    struct sigaction *osa); }
10047	STD	POSIX	{ gid_t getgid(void); }
10148	STD	POSIX	{ int sigprocmask(int how, sigset_t mask); }
10249	STD	BSD	{ int getlogin(char *namebuf, u_int namelen); }
10350	STD	BSD	{ int setlogin(char *namebuf); }
10451	STD	BSD	{ int acct(char *path); }
10552	STD	POSIX	{ int sigpending(void); }
10653	STD	BSD	{ int sigaltstack(struct sigaltstack *nss, \
107			    struct sigaltstack *oss); }
10854	STD	POSIX	{ int ioctl(int fd, u_long com, caddr_t data); }
10955	STD	BSD	{ int reboot(int opt); }
11056	STD	POSIX	{ int revoke(char *path); }
11157	STD	POSIX	{ int symlink(char *path, char *link); }
11258	STD	POSIX	{ int readlink(char *path, char *buf, int count); }
11359	STD	POSIX	{ int execve(char *fname, char **argv, char **envv); }
11460	STD	POSIX	{ int umask(int newmask); } umask umask_args mode_t
11561	STD	BSD	{ int chroot(char *path); }
11662	COMPAT	POSIX	{ int fstat(int fd, struct ostat *sb); }
11763	COMPAT	BSD	{ int getkerninfo(int op, char *where, int *size, \
118			    int arg); } getkerninfo getkerninfo_args int
11964	COMPAT	BSD	{ int getpagesize(void); } \
120			    getpagesize getpagesize_args int
12165	STD	BSD	{ int msync(caddr_t addr, int len, int flags); }
122; XXX should be		{ int msync(caddr_t addr, size_t len, int flags); }
123; but man page and old args struct have `int len'.
12466	NOARGS	BSD	{ int vfork(void); } vfork fork_args int
12567	OBSOL	NOHIDE	vread
12668	OBSOL	NOHIDE	vwrite
12769	STD	BSD	{ int sbrk(int incr); }
12870	STD	BSD	{ int sstk(int incr); }
12971	COMPAT	BSD	{ int mmap(caddr_t addr, int len, int prot, \
130			    int flags, int fd, long pos); }
131; XXX should be		{ int mmap(caddr_t addr, size_t len, int prot,
132;			    int flags, int fd, long pos); }
133; but old args struct has `int len'.
13472	STD	BSD	{ int ovadvise(int anom); } vadvise ovadvise_args int
13573	STD	BSD	{ int munmap(caddr_t addr, int len); }
136; XXX should be		{ int munmap(caddr_t addr, size_t len); }
137; but man page and old args struct have `int len'.
13874	STD	BSD	{ int mprotect(caddr_t addr, int len, int prot); }
139; XXX should be		{ int mprotect(caddr_t addr, size_t len, int prot); }
140; but man page and old args struct have `int len'.
14175	STD	BSD	{ int madvise(caddr_t addr, int len, int behav); }
142; XXX should be		{ int madvise(caddr_t addr, size_t len, int behav); }
143; but man page, madvise() prototype and old args struct have `int len'.
14476	OBSOL	NOHIDE	vhangup
14577	OBSOL	NOHIDE	vlimit
14678	STD	BSD	{ int mincore(caddr_t addr, int len, char *vec); }
147; XXX should be		{ int mincore(caddr_t addr, size_t len, char *vec); }
148; but man page, and old args struct have `int len'.
149; XXX mincore() prototype isn't in <sys/mman.h>.
15079	STD	POSIX	{ int getgroups(u_int gidsetsize, gid_t *gidset); }
15180	STD	POSIX	{ int setgroups(u_int gidsetsize, gid_t *gidset); }
15281	STD	POSIX	{ int getpgrp(void); }
15382	STD	POSIX	{ int setpgid(int pid, int pgid); }
15483	STD	BSD	{ int setitimer(u_int which, struct itimerval *itv, \
155			    struct itimerval *oitv); }
15684	COMPAT	BSD	{ int wait(void); }
15785	STD	BSD	{ int swapon(char *name); }
15886	STD	BSD	{ int getitimer(u_int which, struct itimerval *itv); }
15987	COMPAT	BSD	{ int gethostname(char *hostname, u_int len); } \
160			    gethostname gethostname_args int
16188	COMPAT	BSD	{ int sethostname(char *hostname, u_int len); } \
162			    sethostname sethostname_args int
16389	STD	BSD	{ int getdtablesize(void); }
16490	STD	POSIX	{ int dup2(u_int from, u_int to); }
16591	UNIMPL	BSD	getdopt
16692	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