syscalls.master revision 12864
1	$Id: syscalls.master,v 1.19 1995/11/12 04:24:53 bde 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 <sys/types.h>
28#include <sys/param.h>
29#include <sys/mount.h>
30#include <sys/sysent.h>
31#include <sys/sysproto.h>
32
33; Reserved/unimplemented system calls in the range 0-150 inclusive
34; are reserved for use in future Berkeley releases.
35; Additional system calls implemented in vendor and other
36; redistributions should be placed in the reserved range at the end
37; of the current calls.
38
390	STD	NOHIDE	{ int nosys(void); } syscall nosys_args int
401	STD	NOHIDE	{ void exit(int rval); } exit rexit_args void
412	STD	POSIX	{ int fork(void); }
423	STD	POSIX	{ int read(int fd, char *buf, u_int nbyte); }
434	STD	POSIX	{ int write(int fd, char *buf, u_int nbyte); }
445	STD	POSIX	{ int open(char *path, int flags, int mode); }
45; XXX should be		{ int open(const char *path, int flags, ...); }
46; but we're not ready for `const' or varargs.
47; XXX man page says `mode_t mode'.
486	STD	POSIX	{ int close(int fd); }
497	STD	BSD	{ int wait4(int pid, int *status, int options, \
50			    struct rusage *rusage); } wait4 wait_args int
518	COMPAT	BSD	{ int creat(char *path, int mode); }
529	STD	POSIX	{ int link(char *path, char *link); }
5310	STD	POSIX	{ int unlink(char *path); }
5411	OBSOL	NOHIDE	execv
5512	STD	POSIX	{ int chdir(char *path); }
5613	STD	BSD	{ int fchdir(int fd); }
5714	STD	POSIX	{ int mknod(char *path, int mode, int dev); }
5815	STD	POSIX	{ int chmod(char *path, int mode); }
5916	STD	POSIX	{ int chown(char *path, int uid, int gid); }
6017	STD	BSD	{ int obreak(char *nsize); } break obreak_args int
6118	STD	BSD	{ int getfsstat(struct statfs *buf, long bufsize, \
62			    int flags); }
6319	COMPAT	POSIX	{ long lseek(int fd, long offset, int whence); }
6420	STD	POSIX	{ pid_t getpid(void); }
6521	STD	BSD	{ int mount(int type, char *path, int flags, \
66			    caddr_t data); }
67; XXX 4.4lite2 uses `char *type' but we're not ready for that.
68; XXX `path' should have type `const char *' but we're not ready for that.
6922	STD	BSD	{ int unmount(char *path, int flags); }
7023	STD	POSIX	{ int setuid(uid_t uid); }
7124	STD	POSIX	{ uid_t getuid(void); }
7225	STD	POSIX	{ uid_t geteuid(void); }
7326	STD	BSD	{ int ptrace(int req, pid_t pid, caddr_t addr, \
74			    int data); }
7527	STD	BSD	{ int recvmsg(int s, struct msghdr *msg, int flags); }
7628	STD	BSD	{ int sendmsg(int s, caddr_t msg, int flags); }
7729	STD	BSD	{ int recvfrom(int s, caddr_t buf, size_t len, \
78			    int flags, caddr_t from, int *fromlenaddr); }
7930	STD	BSD	{ int accept(int s, caddr_t name, int *anamelen); }
8031	STD	BSD	{ int getpeername(int fdes, caddr_t asa, int *alen); }
8132	STD	BSD	{ int getsockname(int fdes, caddr_t asa, int *alen); }
8233	STD	POSIX	{ int access(char *path, int flags); }
8334	STD	BSD	{ int chflags(char *path, int flags); }
8435	STD	BSD	{ int fchflags(int fd, int flags); }
8536	STD	BSD	{ int sync(void); }
8637	STD	POSIX	{ int kill(int pid, int signum); }
8738	COMPAT	POSIX	{ int stat(char *path, struct ostat *ub); }
8839	STD	POSIX	{ pid_t getppid(void); }
8940	COMPAT	POSIX	{ int lstat(char *path, struct ostat *ub); }
9041	STD	POSIX	{ int dup(u_int fd); }
9142	STD	POSIX	{ int pipe(void); }
9243	STD	POSIX	{ gid_t getegid(void); }
9344	STD	BSD	{ int profil(caddr_t samples, u_int size, \
94			    u_int offset, u_int scale); }
95#ifdef KTRACE
9645	STD	BSD	{ int ktrace(char *fname, int ops, int facs, \
97			    int pid); }
98#else
9945	UNIMPL	BSD	ktrace
100#endif
10146	STD	POSIX	{ int sigaction(int signum, struct sigaction *nsa, \
102			    struct sigaction *osa); }
10347	STD	POSIX	{ gid_t getgid(void); }
10448	STD	POSIX	{ int sigprocmask(int how, sigset_t mask); }
10549	STD	BSD	{ int getlogin(char *namebuf, u_int namelen); }
10650	STD	BSD	{ int setlogin(char *namebuf); }
10751	STD	BSD	{ int acct(char *path); }
10852	STD	POSIX	{ int sigpending(void); }
10953	STD	BSD	{ int sigaltstack(struct sigaltstack *nss, \
110			    struct sigaltstack *oss); }
11154	STD	POSIX	{ int ioctl(int fd, u_long com, caddr_t data); }
11255	STD	BSD	{ int reboot(int opt); }
11356	STD	POSIX	{ int revoke(char *path); }
11457	STD	POSIX	{ int symlink(char *path, char *link); }
11558	STD	POSIX	{ int readlink(char *path, char *buf, int count); }
11659	STD	POSIX	{ int execve(char *fname, char **argv, char **envv); }
11760	STD	POSIX	{ int umask(int newmask); } umask umask_args mode_t
11861	STD	BSD	{ int chroot(char *path); }
11962	COMPAT	POSIX	{ int fstat(int fd, struct ostat *sb); }
12063	COMPAT	BSD	{ int getkerninfo(int op, char *where, int *size, \
121			    int arg); } getkerninfo getkerninfo_args int
12264	COMPAT	BSD	{ int getpagesize(void); } \
123			    getpagesize getpagesize_args int
12465	STD	BSD	{ int msync(caddr_t addr, int len, int flags); }
125; XXX should be		{ int msync(caddr_t addr, size_t len, int flags); }
126; but man page and old args struct have `int len'.
12766	NOARGS	BSD	{ int vfork(void); } vfork fork_args int
12867	OBSOL	NOHIDE	vread
12968	OBSOL	NOHIDE	vwrite
13069	STD	BSD	{ int sbrk(int incr); }
13170	STD	BSD	{ int sstk(int incr); }
13271	COMPAT	BSD	{ int mmap(caddr_t addr, int len, int prot, \
133			    int flags, int fd, long pos); }
134; XXX should be		{ int mmap(caddr_t addr, size_t len, int prot,
135;			    int flags, int fd, long pos); }
136; but old args struct has `int len'.
13772	STD	BSD	{ int ovadvise(int anom); } vadvise ovadvise_args int
13873	STD	BSD	{ int munmap(caddr_t addr, int len); }
139; XXX should be		{ int munmap(caddr_t addr, size_t len); }
140; but man page and old args struct have `int len'.
14174	STD	BSD	{ int mprotect(caddr_t addr, int len, int prot); }
142; XXX should be		{ int mprotect(caddr_t addr, size_t len, int prot); }
143; but man page and old args struct have `int len'.
14475	STD	BSD	{ int madvise(caddr_t addr, int len, int behav); }
145; XXX should be		{ int madvise(caddr_t addr, size_t len, int behav); }
146; but man page, madvise() prototype and old args struct have `int len'.
14776	OBSOL	NOHIDE	vhangup
14877	OBSOL	NOHIDE	vlimit
14978	STD	BSD	{ int mincore(caddr_t addr, int len, char *vec); }
150; XXX should be		{ int mincore(caddr_t addr, size_t len, char *vec); }
151; but man page, and old args struct have `int len'.
152; XXX mincore() prototype isn't in <sys/mman.h>.
15379	STD	POSIX	{ int getgroups(u_int gidsetsize, gid_t *gidset); }
15480	STD	POSIX	{ int setgroups(u_int gidsetsize, gid_t *gidset); }
15581	STD	POSIX	{ int getpgrp(void); }
15682	STD	POSIX	{ int setpgid(int pid, int pgid); }
15783	STD	BSD	{ int setitimer(u_int which, struct itimerval *itv, \
158			    struct itimerval *oitv); }
15984	COMPAT	BSD	{ int wait(void); }
16085	STD	BSD	{ int swapon(char *name); }
16186	STD	BSD	{ int getitimer(u_int which, struct itimerval *itv); }
16287	COMPAT	BSD	{ int gethostname(char *hostname, u_int len); } \
163			    gethostname gethostname_args int
16488	COMPAT	BSD	{ int sethostname(char *hostname, u_int len); } \
165			    sethostname sethostname_args int
16689	STD	BSD	{ int getdtablesize(void); }
16790	STD	POSIX	{ int dup2(u_int from, u_int to); }
16891	UNIMPL	BSD	getdopt
16992	STD	POSIX	{ int fcntl(int fd, int cmd, int arg); }
170; XXX should be		{ int fcntl(int fd, int cmd, ...); }
171; but we're not ready for varargs.
172; XXX man page says `int arg' too.
17393	STD	BSD	{ int select(u_int nd, fd_set *in, fd_set *ou, \
174			    fd_set *ex, struct timeval *tv); }
17594	UNIMPL	BSD	setdopt
17695	STD	POSIX	{ int fsync(int fd); }
17796	STD	BSD	{ int setpriority(int which, int who, int prio); }
17897	STD	BSD	{ int socket(int domain, int type, int protocol); }
17998	STD	BSD	{ int connect(int s, caddr_t name, int namelen); }
18099	CPT_NOA	BSD	{ int accept(int s, caddr_t name, int *anamelen); } \
181			    accept accept_args int
182100	STD	BSD	{ int getpriority(int which, int who); }
183101	COMPAT	BSD	{ int send(int s, caddr_t buf, int len, int flags); }
184102	COMPAT	BSD	{ int recv(int s, caddr_t buf, int len, int flags); }
185103	STD	BSD	{ int sigreturn(struct sigcontext *sigcntxp); }
186104	STD	BSD	{ int bind(int s, caddr_t name, int namelen); }
187105	STD	BSD	{ int setsockopt(int s, int level, int name, \
188			    caddr_t val, int valsize); }
189106	STD	BSD	{ int listen(int s, int backlog); }
190107	OBSOL	NOHIDE	vtimes
191108	COMPAT	BSD	{ int sigvec(int signum, struct sigvec *nsv, \
192			    struct sigvec *osv); }
193109	COMPAT	BSD	{ int sigblock(int mask); }
194110	COMPAT	BSD	{ int sigsetmask(int mask); }
195111	STD	POSIX	{ int sigsuspend(int mask); }
196112	COMPAT	BSD	{ int sigstack(struct sigstack *nss, \
197			    struct sigstack *oss); }
198113	COMPAT	BSD	{ int recvmsg(int s, struct omsghdr *msg, int flags); }
199114	COMPAT	BSD	{ int sendmsg(int s, caddr_t msg, int flags); }
200115	OBSOL	NOHIDE	vtrace
201116	STD	BSD	{ int gettimeofday(struct timeval *tp, \
202			    struct timezone *tzp); }
203117	STD	BSD	{ int getrusage(int who, struct rusage *rusage); }
204118	STD	BSD	{ int getsockopt(int s, int level, int name, \
205			    caddr_t val, int *avalsize); }
206119	UNIMPL	NOHIDE	nosys
207120	STD	BSD	{ int readv(int fd, struct iovec *iovp, u_int iovcnt); }
208121	STD	BSD	{ int writev(int fd, struct iovec *iovp, \
209			    u_int iovcnt); }
210122	STD	BSD	{ int settimeofday(struct timeval *tv, \
211			    struct timezone *tzp); }
212123	STD	BSD	{ int fchown(int fd, int uid, int gid); }
213124	STD	BSD	{ int fchmod(int fd, int mode); }
214125	CPT_NOA	BSD	{ int recvfrom(int s, caddr_t buf, size_t len, \
215			    int flags, caddr_t from, int *fromlenaddr); } \
216			    recvfrom recvfrom_args int
217126	STD	BSD	{ int setreuid(int ruid, int euid); }
218127	STD	BSD	{ int setregid(int rgid, int egid); }
219128	STD	POSIX	{ int rename(char *from, char *to); }
220129	COMPAT	BSD	{ int truncate(char *path, long length); }
221130	COMPAT	BSD	{ int ftruncate(int fd, long length); }
222131	STD	BSD	{ int flock(int fd, int how); }
223132	STD	POSIX	{ int mkfifo(char *path, int mode); }
224133	STD	BSD	{ int sendto(int s, caddr_t buf, size_t len, \
225			    int flags, caddr_t to, int tolen); }
226134	STD	BSD	{ int shutdown(int s, int how); }
227135	STD	BSD	{ int socketpair(int domain, int type, int protocol, \
228			    int *rsv); }
229136	STD	POSIX	{ int mkdir(char *path, int mode); }
230137	STD	POSIX	{ int rmdir(char *path); }
231138	STD	BSD	{ int utimes(char *path, struct timeval *tptr); }
232139	OBSOL	NOHIDE	4.2 sigreturn
233140	STD	BSD	{ int adjtime(struct timeval *delta, \
234			    struct timeval *olddelta); }
235141	COMPAT	BSD	{ int getpeername(int fdes, caddr_t asa, int *alen); }
236142	COMPAT	BSD	{ long gethostid(void); }
237143	COMPAT	BSD	{ int sethostid(long hostid); }
238144	COMPAT	BSD	{ int getrlimit(u_int which, struct ogetrlimit *rlp); }
239145	COMPAT	BSD	{ int setrlimit(u_int which, struct ogetrlimit *rlp); }
240146	COMPAT	BSD	{ int killpg(int pgid, int signum); }
241147	STD	POSIX	{ int setsid(void); }
242148	STD	BSD	{ int quotactl(char *path, int cmd, int uid, \
243			    caddr_t arg); }
244149	COMPAT	BSD	{ int quota(void); }
245150	CPT_NOA	BSD	{ int getsockname(int fdec, caddr_t asa, int *alen); }\
246			    getsockname getsockname_args int
247
248; Syscalls 151-180 inclusive are reserved for vendor-specific
249; system calls.  (This includes various calls added for compatibity
250; with other Unix variants.)
251; Some of these calls are now supported by BSD...
252151	UNIMPL	NOHIDE	nosys
253152	UNIMPL	NOHIDE	nosys
254153	UNIMPL	NOHIDE	nosys
255154	UNIMPL	NOHIDE	nosys
256#ifdef NFS
257155	STD	BSD	{ int nfssvc(int flag, caddr_t argp); }
258#else
259155	UNIMPL	BSD	nosys
260#endif
261156	COMPAT	BSD	{ int getdirentries(int fd, char *buf, u_int count, \
262			    long *basep); }
263157	STD	BSD	{ int statfs(char *path, struct statfs *buf); }
264158	STD	BSD	{ int fstatfs(int fd, struct statfs *buf); }
265159	UNIMPL	NOHIDE	nosys
266160	UNIMPL	NOHIDE	nosys
267#ifdef NFS
268161	STD	BSD	{ int getfh(char *fname, fhandle_t *fhp); }
269#else
270161	UNIMPL	BSD	nosys
271#endif
272162	STD	BSD	{ int getdomainname(char *domainname, int len); }
273163	STD	BSD	{ int setdomainname(char *domainname, int len); }
274164	STD	BSD	{ int uname(struct utsname *name); }
275165	STD	BSD	{ int sysarch(int op, char *parms); }
276166	STD	BSD	{ int rtprio(int function, pid_t pid, \
277			    struct rtprio *rtp); }
278167	UNIMPL	NOHIDE	nosys
279168	UNIMPL	NOHIDE	nosys
280#ifdef SYSVSEM
281169	STD	BSD	{ int semsys(int which, int a2, int a3, int a4, \
282			    int a5); }
283; XXX should be		{ int semsys(int which, ...); }
284#else
285169	UNIMPL	NOHIDE	nosys
286#endif
287#ifdef SYSVMSG
288170	STD	BSD	{ int msgsys(int which, int a2, int a3, int a4, \
289			    int a5, int a6); }
290; XXX should be		{ int msgsys(int which, ...); }
291#else
292170	UNIMPL	NOHIDE nosys
293#endif
294#ifdef SYSVSHM
295171	STD	BSD	{ int shmsys(int which, int a2, int a3, int a4); }
296; XXX should be		{ int shmsys(int which, ...); }
297#else
298171	UNIMPL	BSD	nosys
299#endif
300172	UNIMPL	NOHIDE	nosys
301173	UNIMPL	NOHIDE	nosys
302174	UNIMPL	NOHIDE	nosys
303175	UNIMPL	NOHIDE	nosys
304176	STD	BSD	{ int ntp_adjtime(struct timex *tp); }
305177	UNIMPL	NOHIDE	nosys
306178	UNIMPL	NOHIDE	nosys
307179	UNIMPL	NOHIDE	nosys
308180	UNIMPL	NOHIDE	nosys
309
310; Syscalls 180-199 are used by/reserved for BSD
311181	STD	POSIX	{ int setgid(gid_t gid); }
312182	STD	BSD	{ int setegid(gid_t egid); }
313183	STD	BSD	{ int seteuid(uid_t euid); }
314#ifdef LFS
315184	STD	BSD	{ int lfs_bmapv(fsid_t *fsidp, \
316			    struct block_info *blkiov, int blkcnt); }
317185	STD	BSD	{ int lfs_markv(fsid_t *fsidp, \
318			    struct block_info *blkiov, int blkcnt); }
319186	STD	BSD	{ int lfs_segclean(fsid_t *fsidp, u_long segment); }
320187	STD	BSD	{ int lfs_segwait(fsid_t *fsidp, struct timeval *tv); }
321#else
322184	UNIMPL	BSD	nosys
323185	UNIMPL	BSD	nosys
324186	UNIMPL	BSD	nosys
325187	UNIMPL	BSD	nosys
326#endif
327188	STD	POSIX	{ int stat(char *path, struct stat *ub); }
328189	STD	POSIX	{ int fstat(int fd, struct stat *sb); }
329190	STD	POSIX	{ int lstat(char *path, struct stat *ub); }
330191	STD	POSIX	{ int pathconf(char *path, int name); }
331192	STD	POSIX	{ int fpathconf(int fd, int name); }
332193	UNIMPL	NOHIDE	nosys
333194	STD	BSD	{ int getrlimit(u_int which, \
334			    struct orlimit *rlp); } \
335			    getrlimit __getrlimit_args int
336195	STD	BSD	{ int setrlimit(u_int which, \
337			    struct orlimit *rlp); } \
338			    setrlimit __setrlimit_args int
339196	STD	BSD	{ int getdirentries(int fd, char *buf, u_int count, \
340			    long *basep); }
341197	STD	BSD	{ caddr_t mmap(caddr_t addr, size_t len, int prot, \
342			    int flags, int fd, long pad, off_t pos); }
343198	STD	NOHIDE	{ int nosys(void); } __syscall __syscall_args int
344199	STD	POSIX	{ off_t lseek(int fd, int pad, off_t offset, \
345			    int whence); }
346200	STD	BSD	{ int truncate(char *path, int pad, off_t length); }
347201	STD	BSD	{ int ftruncate(int fd, int pad, off_t length); }
348202	STD	BSD	{ int __sysctl(int *name, u_int namelen, void *old, \
349			    size_t *oldlenp, void *new, size_t newlen); } \
350			    __sysctl sysctl_args int
351; properly, __sysctl should be a NOHIDE, but making an exception
352; here allows to avoid one in libc/sys/Makefile.inc.
353203	STD	BSD	{ int mlock(caddr_t addr, size_t len); }
354204	STD	BSD	{ int munlock(caddr_t addr, size_t len); }
355205	UNIMPL	NOHIDE	nosys
356206	UNIMPL	NOHIDE	nosys
357207	UNIMPL	NOHIDE	nosys
358208	UNIMPL	NOHIDE	nosys
359209	UNIMPL	NOHIDE	nosys
360
361;
362; The following are reserved for loadable syscalls
363;
364210	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
365211	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
366212	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
367213	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
368214	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
369215	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
370216	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
371217	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
372218	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
373219	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
374
375;
376; The following were originally used in NetBSD.
377;
378#ifdef SYSVSEM
379220	STD	BSD	{ int __semctl(int semid, int semnum, int cmd, \
380			    union semun *arg); }
381221	STD	BSD	{ int semget(key_t key, int nsems, int semflg); }
382222	STD	BSD	{ int semop(int semid, struct sembuf *sops, \
383			    u_int nsops); }
384223	STD	BSD	{ int semconfig(int flag); }
385#else
386220	UNIMPL	BSD	semctl
387221	UNIMPL	BSD	semget
388222	UNIMPL	BSD	semop
389223	UNIMPL	BSD	semconfig
390#endif
391#ifdef SYSVMSG
392224	STD	BSD	{ int msgctl(int msqid, int cmd, \
393			    struct msqid_ds *buf); }
394225	STD	BSD	{ int msgget(key_t key, int msgflg); }
395226	STD	BSD	{ int msgsnd(int msqid, void *msgp, size_t msgsz, \
396			    int msgflg); }
397227	STD	BSD	{ int msgrcv(int msqid, void *msgp, size_t msgsz, \
398			    long msgtyp, int msgflg); }
399#else
400224	UNIMPL	BSD	msgctl
401225	UNIMPL	BSD	msgget
402226	UNIMPL	BSD	msgsnd
403227	UNIMPL	BSD	msgrcv
404#endif
405#ifdef SYSVSHM
406228	STD	BSD	{ int shmat(int shmid, void *shmaddr, int shmflg); }
407229	STD	BSD	{ int shmctl(int shmid, int cmd, \
408			    struct shmid_ds *buf); }
409230	STD	BSD	{ int shmdt(void *shmaddr); }
410231	STD	BSD	{ int shmget(key_t key, int size, int shmflg); }
411#else
412228	UNIMPL	BSD	shmat
413229	UNIMPL	BSD	shmctl
414230	UNIMPL	BSD	shmdt
415231	UNIMPL	BSD	shmget
416#endif
417