syscalls.master revision 105476
146969Smjacob $FreeBSD: head/sys/kern/syscalls.master 105476 2002-10-19 21:06:57Z rwatson $
246969Smjacob;	from: @(#)syscalls.master	8.2 (Berkeley) 1/13/94
335388Smjacob;
435388Smjacob; System call name/number master file.
535388Smjacob; Processed to created init_sysent.c, syscalls.c and syscall.h.
635388Smjacob
735388Smjacob; Columns: number [M]type nargs namespc name alt{name,tag,rtyp}/comments
835388Smjacob;	number	system call number, must be in order
935388Smjacob;	type	one of [M]STD, [M]OBSOL, [M]UNIMPL, [M]COMPAT, [M]CPT_NOA,
1035388Smjacob;		[M]LIBCOMPAT, [M]NODEF,  [M]NOARGS,  [M]NOPROTO,  [M]NOIMPL,
1135388Smjacob;		[M]NOSTD, [M]COMPAT4
1235388Smjacob;	namespc one of POSIX, BSD, NOHIDE
1335388Smjacob;	name	psuedo-prototype of syscall routine
1435388Smjacob;		If one of the following alts is different, then all appear:
1535388Smjacob;	altname	name of system call if different
1635388Smjacob;	alttag	name of args struct tag if different from [o]`name'"_args"
1735388Smjacob;	altrtyp	return type if not int (bogus - syscalls always return int)
1835388Smjacob;		for UNIMPL/OBSOL, name continues with comments
1935388Smjacob
2035388Smjacob; types:
2135388Smjacob;	[M]	e.g. like MSTD -- means the system call is MP-safe.  If no
2235388Smjacob;		M prefix is used, the syscall wrapper will obtain the Giant
2335388Smjacob;		lock for the syscall.
2435388Smjacob;	STD	always included
2535388Smjacob;	COMPAT	included on COMPAT #ifdef
2635388Smjacob;	COMPAT4	included on COMPAT4 #ifdef (FreeBSD 4 compat)
2735388Smjacob;	LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h
2835388Smjacob;	OBSOL	obsolete, not included in system, only specifies name
2935388Smjacob;	UNIMPL	not implemented, placeholder only
3035388Smjacob;	NOSTD	implemented but as a lkm that can be statically
3135388Smjacob;			compiled in sysent entry will be filled with lkmsys
3235388Smjacob;			so the SYSCALL_MODULE macro works
3335388Smjacob;
3435388Smjacob; Please copy any additions and changes to the following compatability tables:
3535388Smjacob; sys/ia64/ia32/syscalls.master  (take a best guess)
3635388Smjacob; [other 64 bit platforms with an alternate 32 bit syscall table go here too]
3735388Smjacob; #ifdef's, etc. may be included, and are copied to the output files.
3839235Sgibbs
3945284Smjacob#include <sys/param.h>
4039235Sgibbs#include <sys/sysent.h>
4139445Smjacob#include <sys/sysproto.h>
4239445Smjacob
4339445Smjacob; Reserved/unimplemented system calls in the range 0-150 inclusive
4439445Smjacob; are reserved for use in future Berkeley releases.
4539445Smjacob; Additional system calls implemented in vendor and other
4639445Smjacob; redistributions should be placed in the reserved range at the end
4739445Smjacob; of the current calls.
4844819Smjacob
4939235Sgibbs0	STD	NOHIDE	{ int nosys(void); } syscall nosys_args int
5039235Sgibbs1	MSTD	NOHIDE	{ void sys_exit(int rval); } exit sys_exit_args void
5145284Smjacob2	MSTD	POSIX	{ int fork(void); }
5245284Smjacob3	MSTD	POSIX	{ ssize_t read(int fd, void *buf, size_t nbyte); }
5345284Smjacob4	MSTD	POSIX	{ ssize_t write(int fd, const void *buf, size_t nbyte); }
5445284Smjacob5	STD	POSIX	{ int open(char *path, int flags, int mode); }
5539235Sgibbs; XXX should be		{ int open(const char *path, int flags, ...); }
5635388Smjacob; but we're not ready for `const' or varargs.
5735388Smjacob; XXX man page says `mode_t mode'.
5835388Smjacob6	MSTD	POSIX	{ int close(int fd); }
5935388Smjacob7	MSTD	BSD	{ int wait4(int pid, int *status, int options, \
6035388Smjacob			    struct rusage *rusage); } wait4 wait_args int
6135388Smjacob8	COMPAT	BSD	{ int creat(char *path, int mode); }
6235388Smjacob9	STD	POSIX	{ int link(char *path, char *link); }
6335388Smjacob10	STD	POSIX	{ int unlink(char *path); }
6435388Smjacob11	OBSOL	NOHIDE	execv
6535388Smjacob12	STD	POSIX	{ int chdir(char *path); }
6635388Smjacob13	STD	BSD	{ int fchdir(int fd); }
6735388Smjacob14	STD	POSIX	{ int mknod(char *path, int mode, int dev); }
6844819Smjacob15	STD	POSIX	{ int chmod(char *path, int mode); }
6945284Smjacob16	STD	POSIX	{ int chown(char *path, int uid, int gid); }
7044819Smjacob17	MSTD	BSD	{ int obreak(char *nsize); } break obreak_args int
7135388Smjacob18	STD	BSD	{ int getfsstat(struct statfs *buf, long bufsize, \
7235388Smjacob			    int flags); }
7335388Smjacob19	COMPAT	POSIX	{ long lseek(int fd, long offset, int whence); }
7435388Smjacob20	MSTD	POSIX	{ pid_t getpid(void); }
7545284Smjacob21	STD	BSD	{ int mount(char *type, char *path, int flags, \
7635388Smjacob			    caddr_t data); }
7739235Sgibbs; XXX `path' should have type `const char *' but we're not ready for that.
7845284Smjacob22	STD	BSD	{ int unmount(char *path, int flags); }
7945284Smjacob23	MSTD	POSIX	{ int setuid(uid_t uid); }
8045284Smjacob24	MSTD	POSIX	{ uid_t getuid(void); }
8145284Smjacob25	MSTD	POSIX	{ uid_t geteuid(void); }
8244819Smjacob26	STD	BSD	{ int ptrace(int req, pid_t pid, caddr_t addr, \
8335388Smjacob			    int data); }
8435388Smjacob27	MSTD	BSD	{ int recvmsg(int s, struct msghdr *msg, int flags); }
8542131Smjacob28	MSTD	BSD	{ int sendmsg(int s, caddr_t msg, int flags); }
8639235Sgibbs29	MSTD	BSD	{ int recvfrom(int s, caddr_t buf, size_t len, \
8739235Sgibbs			    int flags, caddr_t from, int *fromlenaddr); }
8839235Sgibbs30	MSTD	BSD	{ int accept(int s, caddr_t name, int *anamelen); }
8939235Sgibbs31	MSTD	BSD	{ int getpeername(int fdes, caddr_t asa, int *alen); }
9035388Smjacob32	MSTD	BSD	{ int getsockname(int fdes, caddr_t asa, int *alen); }
9135388Smjacob33	STD	POSIX	{ int access(char *path, int flags); }
9235388Smjacob34	STD	BSD	{ int chflags(char *path, int flags); }
9339235Sgibbs35	STD	BSD	{ int fchflags(int fd, int flags); }
9439235Sgibbs36	STD	BSD	{ int sync(void); }
9545040Smjacob37	MSTD	POSIX	{ int kill(int pid, int signum); }
9645040Smjacob38	COMPAT	POSIX	{ int stat(char *path, struct ostat *ub); }
9746969Smjacob39	MSTD	POSIX	{ pid_t getppid(void); }
9835388Smjacob40	COMPAT	POSIX	{ int lstat(char *path, struct ostat *ub); }
9935388Smjacob41	STD	POSIX	{ int dup(u_int fd); }
10035388Smjacob42	STD	POSIX	{ int pipe(void); }
10135388Smjacob43	MSTD	POSIX	{ gid_t getegid(void); }
10235388Smjacob44	MSTD	BSD	{ int profil(caddr_t samples, size_t size, \
10335388Smjacob			    size_t offset, u_int scale); }
10435388Smjacob45	STD	BSD	{ int ktrace(const char *fname, int ops, int facs, \
10541522Smjacob			    int pid); }
10635388Smjacob46	MCOMPAT	POSIX	{ int sigaction(int signum, struct osigaction *nsa, \
10735388Smjacob			    struct osigaction *osa); }
10835388Smjacob47	MSTD	POSIX	{ gid_t getgid(void); }
10935388Smjacob48	MCOMPAT	POSIX	{ int sigprocmask(int how, osigset_t mask); }
11035388Smjacob; XXX note nonstandard (bogus) calling convention - the libc stub passes
11135388Smjacob; us the mask, not a pointer to it, and we return the old mask as the
11235388Smjacob; (int) return value.
11335388Smjacob49	MSTD	BSD	{ int getlogin(char *namebuf, u_int namelen); }
11435388Smjacob50	MSTD	BSD	{ int setlogin(char *namebuf); }
11539235Sgibbs51	MSTD	BSD	{ int acct(char *path); }
11639235Sgibbs52	MCOMPAT	POSIX	{ int sigpending(void); }
11735388Smjacob53	MSTD	BSD	{ int sigaltstack(stack_t *ss, stack_t *oss); }
11835388Smjacob54	MSTD	POSIX	{ int ioctl(int fd, u_long com, caddr_t data); }
11935388Smjacob55	MSTD	BSD	{ int reboot(int opt); }
12035388Smjacob56	STD	POSIX	{ int revoke(char *path); }
12135388Smjacob57	STD	POSIX	{ int symlink(char *path, char *link); }
12235388Smjacob58	STD	POSIX	{ int readlink(char *path, char *buf, int count); }
12335388Smjacob59	MSTD	POSIX	{ int execve(char *fname, char **argv, char **envv); }
12435388Smjacob60	MSTD	POSIX	{ int umask(int newmask); } umask umask_args int
12535388Smjacob61	STD	BSD	{ int chroot(char *path); }
12635388Smjacob62	MCOMPAT	POSIX	{ int fstat(int fd, struct ostat *sb); }
12735388Smjacob63	MCOMPAT	BSD	{ int getkerninfo(int op, char *where, size_t *size, \
12835388Smjacob			    int arg); } getkerninfo getkerninfo_args int
12939235Sgibbs64	MCOMPAT	BSD	{ int getpagesize(void); } \
13039235Sgibbs			    getpagesize getpagesize_args int
13139235Sgibbs65	STD	BSD	{ int msync(void *addr, size_t len, int flags); }
13239235Sgibbs66	MSTD	BSD	{ int vfork(void); }
13335388Smjacob67	OBSOL	NOHIDE	vread
13439235Sgibbs68	OBSOL	NOHIDE	vwrite
13539235Sgibbs69	MSTD	BSD	{ int sbrk(int incr); }
13639235Sgibbs70	MSTD	BSD	{ int sstk(int incr); }
13742131Smjacob71	MCOMPAT	BSD	{ int mmap(void *addr, int len, int prot, \
13839235Sgibbs			    int flags, int fd, long pos); }
13939235Sgibbs72	MSTD	BSD	{ int ovadvise(int anom); } vadvise ovadvise_args int
14035388Smjacob73	MSTD	BSD	{ int munmap(void *addr, size_t len); }
14135388Smjacob74	MSTD	BSD	{ int mprotect(const void *addr, size_t len, int prot); }
14235388Smjacob75	MSTD	BSD	{ int madvise(void *addr, size_t len, int behav); }
14335388Smjacob76	OBSOL	NOHIDE	vhangup
14435388Smjacob77	OBSOL	NOHIDE	vlimit
14535388Smjacob78	MSTD	BSD	{ int mincore(const void *addr, size_t len, \
14646969Smjacob			    char *vec); }
14746969Smjacob79	MSTD	POSIX	{ int getgroups(u_int gidsetsize, gid_t *gidset); }
14839445Smjacob80	MSTD	POSIX	{ int setgroups(u_int gidsetsize, gid_t *gidset); }
14944819Smjacob81	MSTD	POSIX	{ int getpgrp(void); }
15044819Smjacob82	MSTD	POSIX	{ int setpgid(int pid, int pgid); }
15144819Smjacob83	MSTD	BSD	{ int setitimer(u_int which, struct itimerval *itv, \
15244819Smjacob			    struct itimerval *oitv); }
15344819Smjacob84	MCOMPAT	BSD	{ int wait(void); }
15444819Smjacob85	MSTD	BSD	{ int swapon(char *name); }
15544819Smjacob86	MSTD	BSD	{ int getitimer(u_int which, struct itimerval *itv); }
15644819Smjacob87	MCOMPAT	BSD	{ int gethostname(char *hostname, u_int len); } \
15744819Smjacob			    gethostname gethostname_args int
15844819Smjacob88	MCOMPAT	BSD	{ int sethostname(char *hostname, u_int len); } \
15944819Smjacob			    sethostname sethostname_args int
16044819Smjacob89	MSTD	BSD	{ int getdtablesize(void); }
16144819Smjacob90	MSTD	POSIX	{ int dup2(u_int from, u_int to); }
16245284Smjacob91	UNIMPL	BSD	getdopt
16345284Smjacob92	MSTD	POSIX	{ int fcntl(int fd, int cmd, long arg); }
16445284Smjacob; XXX should be		{ int fcntl(int fd, int cmd, ...); }
16544819Smjacob; but we're not ready for varargs.
16644819Smjacob93	MSTD	BSD	{ int select(int nd, fd_set *in, fd_set *ou, \
16744819Smjacob			    fd_set *ex, struct timeval *tv); }
16844819Smjacob94	UNIMPL	BSD	setdopt
16944819Smjacob95	STD	POSIX	{ int fsync(int fd); }
17044819Smjacob96	MSTD	BSD	{ int setpriority(int which, int who, int prio); }
17144819Smjacob97	MSTD	BSD	{ int socket(int domain, int type, int protocol); }
17244819Smjacob98	MSTD	BSD	{ int connect(int s, caddr_t name, int namelen); }
17344819Smjacob99	MCPT_NOA BSD	{ int accept(int s, caddr_t name, int *anamelen); } \
17444819Smjacob			    accept accept_args int
17544819Smjacob100	MSTD	BSD	{ int getpriority(int which, int who); }
17644819Smjacob101	MCOMPAT	BSD	{ int send(int s, caddr_t buf, int len, int flags); }
17744819Smjacob102	MCOMPAT	BSD	{ int recv(int s, caddr_t buf, int len, int flags); }
17844819Smjacob103	MSTD	BSD	{ int osigreturn(struct osigcontext *sigcntxp); }
17944819Smjacob104	MSTD	BSD	{ int bind(int s, caddr_t name, int namelen); }
18044819Smjacob105	MSTD	BSD	{ int setsockopt(int s, int level, int name, \
18144819Smjacob			    caddr_t val, int valsize); }
18244819Smjacob106	MSTD	BSD	{ int listen(int s, int backlog); }
18344819Smjacob107	OBSOL	NOHIDE	vtimes
18444819Smjacob108	MCOMPAT	BSD	{ int sigvec(int signum, struct sigvec *nsv, \
18544819Smjacob			    struct sigvec *osv); }
18644819Smjacob109	MCOMPAT	BSD	{ int sigblock(int mask); }
18744819Smjacob110	MCOMPAT	BSD	{ int sigsetmask(int mask); }
18844819Smjacob111	MCOMPAT	POSIX	{ int sigsuspend(osigset_t mask); }
18944819Smjacob; XXX note nonstandard (bogus) calling convention - the libc stub passes
19044819Smjacob; us the mask, not a pointer to it.
19144819Smjacob112	MCOMPAT	BSD	{ int sigstack(struct sigstack *nss, \
19244819Smjacob			    struct sigstack *oss); }
19344819Smjacob113	MCOMPAT	BSD	{ int recvmsg(int s, struct omsghdr *msg, int flags); }
19444819Smjacob114	MCOMPAT	BSD	{ int sendmsg(int s, caddr_t msg, int flags); }
19544819Smjacob115	OBSOL	NOHIDE	vtrace
19644819Smjacob116	MSTD	BSD	{ int gettimeofday(struct timeval *tp, \
19744819Smjacob			    struct timezone *tzp); }
19844819Smjacob117	MSTD	BSD	{ int getrusage(int who, struct rusage *rusage); }
19944819Smjacob118	MSTD	BSD	{ int getsockopt(int s, int level, int name, \
20044819Smjacob			    caddr_t val, int *avalsize); }
20144819Smjacob119	UNIMPL	NOHIDE	resuba (BSD/OS 2.x)
20244819Smjacob120	MSTD	BSD	{ int readv(int fd, struct iovec *iovp, u_int iovcnt); }
20344819Smjacob121	MSTD	BSD	{ int writev(int fd, struct iovec *iovp, \
20444819Smjacob			    u_int iovcnt); }
20544819Smjacob122	MSTD	BSD	{ int settimeofday(struct timeval *tv, \
20644819Smjacob			    struct timezone *tzp); }
20744819Smjacob123	STD	BSD	{ int fchown(int fd, int uid, int gid); }
20844819Smjacob124	STD	BSD	{ int fchmod(int fd, int mode); }
20944819Smjacob125	MCPT_NOA BSD	{ int recvfrom(int s, caddr_t buf, size_t len, \
21044819Smjacob			    int flags, caddr_t from, int *fromlenaddr); } \
21144819Smjacob			    recvfrom recvfrom_args int
21246969Smjacob126	MSTD	BSD	{ int setreuid(int ruid, int euid); }
21344819Smjacob127	MSTD	BSD	{ int setregid(int rgid, int egid); }
21444819Smjacob128	STD	POSIX	{ int rename(char *from, char *to); }
21544819Smjacob129	COMPAT	BSD	{ int truncate(char *path, long length); }
21644819Smjacob130	COMPAT	BSD	{ int ftruncate(int fd, long length); }
21744819Smjacob131	MSTD	BSD	{ int flock(int fd, int how); }
21844819Smjacob132	STD	POSIX	{ int mkfifo(char *path, int mode); }
21944819Smjacob133	MSTD	BSD	{ int sendto(int s, caddr_t buf, size_t len, \
22044819Smjacob			    int flags, caddr_t to, int tolen); }
22144819Smjacob134	MSTD	BSD	{ int shutdown(int s, int how); }
22244819Smjacob135	MSTD	BSD	{ int socketpair(int domain, int type, int protocol, \
22344819Smjacob			    int *rsv); }
22444819Smjacob136	STD	POSIX	{ int mkdir(char *path, int mode); }
22544819Smjacob137	STD	POSIX	{ int rmdir(char *path); }
22644819Smjacob138	STD	BSD	{ int utimes(char *path, struct timeval *tptr); }
22744819Smjacob139	OBSOL	NOHIDE	4.2 sigreturn
22846969Smjacob140	MSTD	BSD	{ int adjtime(struct timeval *delta, \
22944819Smjacob			    struct timeval *olddelta); }
23044819Smjacob141	MCOMPAT	BSD	{ int getpeername(int fdes, caddr_t asa, int *alen); }
23144819Smjacob142	MCOMPAT	BSD	{ long gethostid(void); }
23244819Smjacob143	MCOMPAT	BSD	{ int sethostid(long hostid); }
23344819Smjacob144	MCOMPAT	BSD	{ int getrlimit(u_int which, struct orlimit *rlp); }
23444819Smjacob145	MCOMPAT	BSD	{ int setrlimit(u_int which, struct orlimit *rlp); }
23544819Smjacob146	MCOMPAT	BSD	{ int killpg(int pgid, int signum); }
23644819Smjacob147	MSTD	POSIX	{ int setsid(void); }
23744819Smjacob148	STD	BSD	{ int quotactl(char *path, int cmd, int uid, \
23844819Smjacob			    caddr_t arg); }
23944819Smjacob149	MCOMPAT	BSD	{ int quota(void); }
24044819Smjacob150	MCPT_NOA BSD	{ int getsockname(int fdec, caddr_t asa, int *alen); }\
24144819Smjacob			    getsockname getsockname_args int
24244819Smjacob
24344819Smjacob; Syscalls 151-180 inclusive are reserved for vendor-specific
24444819Smjacob; system calls.  (This includes various calls added for compatibity
24544819Smjacob; with other Unix variants.)
24644819Smjacob; Some of these calls are now supported by BSD...
24744819Smjacob151	UNIMPL	NOHIDE	sem_lock (BSD/OS 2.x)
24844819Smjacob152	UNIMPL	NOHIDE	sem_wakeup (BSD/OS 2.x)
24944819Smjacob153	UNIMPL	NOHIDE	asyncdaemon (BSD/OS 2.x)
25046969Smjacob154	UNIMPL	NOHIDE	nosys
25144819Smjacob; 155 is initialized by the NFS code, if present.
25244819Smjacob155	MNOIMPL	BSD	{ int nfssvc(int flag, caddr_t argp); }
25344819Smjacob156	COMPAT	BSD	{ int getdirentries(int fd, char *buf, u_int count, \
25444819Smjacob			    long *basep); }
25546969Smjacob157	STD	BSD	{ int statfs(char *path, struct statfs *buf); }
25635388Smjacob158	STD	BSD	{ int fstatfs(int fd, struct statfs *buf); }
257159	UNIMPL	NOHIDE	nosys
258160	UNIMPL	NOHIDE	nosys
259161	STD	BSD	{ int getfh(char *fname, struct fhandle *fhp); }
260162	MSTD	BSD	{ int getdomainname(char *domainname, int len); }
261163	MSTD	BSD	{ int setdomainname(char *domainname, int len); }
262164	MSTD	BSD	{ int uname(struct utsname *name); }
263165	STD	BSD	{ int sysarch(int op, char *parms); }
264166	MSTD	BSD	{ int rtprio(int function, pid_t pid, \
265			    struct rtprio *rtp); }
266167	UNIMPL	NOHIDE	nosys
267168	UNIMPL	NOHIDE	nosys
268; 169 is initialized by the SYSVSEM code if present or loaded
269169	MNOSTD	BSD	{ int semsys(int which, int a2, int a3, int a4, \
270			    int a5); }
271; 169 is initialized by the SYSVMSG code if present or loaded
272; XXX should be		{ int semsys(int which, ...); }
273170	MNOSTD	BSD	{ int msgsys(int which, int a2, int a3, int a4, \
274			    int a5, int a6); }
275; 169 is initialized by the SYSVSHM code if present or loaded
276; XXX should be		{ int msgsys(int which, ...); }
277171	MNOSTD	BSD	{ int shmsys(int which, int a2, int a3, int a4); }
278; XXX should be		{ int shmsys(int which, ...); }
279172	UNIMPL	NOHIDE	nosys
280173	MSTD	POSIX	{ ssize_t pread(int fd, void *buf, size_t nbyte, \
281			    int pad, off_t offset); }
282174	MSTD	POSIX	{ ssize_t pwrite(int fd, const void *buf, \
283			    size_t nbyte, int pad, off_t offset); }
284175	UNIMPL	NOHIDE	nosys
285176	MSTD	BSD	{ int ntp_adjtime(struct timex *tp); }
286177	UNIMPL	NOHIDE	sfork (BSD/OS 2.x)
287178	UNIMPL	NOHIDE	getdescriptor (BSD/OS 2.x)
288179	UNIMPL	NOHIDE	setdescriptor (BSD/OS 2.x)
289180	UNIMPL	NOHIDE	nosys
290
291; Syscalls 181-199 are used by/reserved for BSD
292181	MSTD	POSIX	{ int setgid(gid_t gid); }
293182	MSTD	BSD	{ int setegid(gid_t egid); }
294183	MSTD	BSD	{ int seteuid(uid_t euid); }
295184	UNIMPL	BSD	lfs_bmapv
296185	UNIMPL	BSD	lfs_markv
297186	UNIMPL	BSD	lfs_segclean
298187	UNIMPL	BSD	lfs_segwait
299188	STD	POSIX	{ int stat(char *path, struct stat *ub); }
300189	MSTD	POSIX	{ int fstat(int fd, struct stat *sb); }
301190	STD	POSIX	{ int lstat(char *path, struct stat *ub); }
302191	STD	POSIX	{ int pathconf(char *path, int name); }
303192	MSTD	POSIX	{ int fpathconf(int fd, int name); }
304193	UNIMPL	NOHIDE	nosys
305194	MSTD	BSD	{ int getrlimit(u_int which, \
306			    struct rlimit *rlp); } \
307			    getrlimit __getrlimit_args int
308195	MSTD	BSD	{ int setrlimit(u_int which, \
309			    struct rlimit *rlp); } \
310			    setrlimit __setrlimit_args int
311196	STD	BSD	{ int getdirentries(int fd, char *buf, u_int count, \
312			    long *basep); }
313197	MSTD	BSD	{ caddr_t mmap(caddr_t addr, size_t len, int prot, \
314			    int flags, int fd, int pad, off_t pos); }
315198	STD	NOHIDE	{ int nosys(void); } __syscall __syscall_args int
316199	STD	POSIX	{ off_t lseek(int fd, int pad, off_t offset, \
317			    int whence); }
318200	STD	BSD	{ int truncate(char *path, int pad, off_t length); }
319201	STD	BSD	{ int ftruncate(int fd, int pad, off_t length); }
320202	MSTD	BSD	{ int __sysctl(int *name, u_int namelen, void *old, \
321			    size_t *oldlenp, void *new, size_t newlen); } \
322			    __sysctl sysctl_args int
323; properly, __sysctl should be a NOHIDE, but making an exception
324; here allows to avoid one in libc/sys/Makefile.inc.
325203	MSTD	BSD	{ int mlock(const void *addr, size_t len); }
326204	MSTD	BSD	{ int munlock(const void *addr, size_t len); }
327205	STD	BSD	{ int undelete(char *path); }
328206	STD	BSD	{ int futimes(int fd, struct timeval *tptr); }
329207	MSTD	BSD	{ int getpgid(pid_t pid); }
330208	UNIMPL	NOHIDE	newreboot (NetBSD)
331209	MSTD	BSD	{ int poll(struct pollfd *fds, u_int nfds, \
332			    int timeout); }
333
334;
335; The following are reserved for loadable syscalls
336;
337210	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
338211	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
339212	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
340213	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
341214	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
342215	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
343216	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
344217	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
345218	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
346219	NODEF	NOHIDE	lkmnosys lkmnosys nosys_args int
347
348;
349; The following were introduced with NetBSD/4.4Lite-2
350; They are initialized by thier respective modules/sysinits
351220	MNOSTD	BSD	{ int __semctl(int semid, int semnum, int cmd, \
352			    union semun *arg); }
353221	MNOSTD	BSD	{ int semget(key_t key, int nsems, int semflg); }
354222	MNOSTD	BSD	{ int semop(int semid, struct sembuf *sops, \
355			    u_int nsops); }
356223	UNIMPL	NOHIDE	semconfig
357224	MNOSTD	BSD	{ int msgctl(int msqid, int cmd, \
358			    struct msqid_ds *buf); }
359225	MNOSTD	BSD	{ int msgget(key_t key, int msgflg); }
360226	MNOSTD	BSD	{ int msgsnd(int msqid, void *msgp, size_t msgsz, \
361			    int msgflg); }
362227	MNOSTD	BSD	{ int msgrcv(int msqid, void *msgp, size_t msgsz, \
363			    long msgtyp, int msgflg); }
364228	MNOSTD	BSD	{ int shmat(int shmid, void *shmaddr, int shmflg); }
365229	MNOSTD	BSD	{ int shmctl(int shmid, int cmd, \
366			    struct shmid_ds *buf); }
367230	MNOSTD	BSD	{ int shmdt(void *shmaddr); }
368231	MNOSTD	BSD	{ int shmget(key_t key, int size, int shmflg); }
369;
370232	MSTD	POSIX	{ int clock_gettime(clockid_t clock_id, \
371			    struct timespec *tp); }
372233	MSTD	POSIX	{ int clock_settime(clockid_t clock_id, \
373			    const struct timespec *tp); }
374234	MSTD	POSIX	{ int clock_getres(clockid_t clock_id, \
375			    struct timespec *tp); }
376235	UNIMPL	NOHIDE	timer_create
377236	UNIMPL	NOHIDE	timer_delete
378237	UNIMPL	NOHIDE	timer_settime
379238	UNIMPL	NOHIDE	timer_gettime
380239	UNIMPL	NOHIDE	timer_getoverrun
381240	MSTD	POSIX	{ int nanosleep(const struct timespec *rqtp, \
382			    struct timespec *rmtp); }
383241	UNIMPL	NOHIDE	nosys
384242	UNIMPL	NOHIDE	nosys
385243	UNIMPL	NOHIDE	nosys
386244	UNIMPL	NOHIDE	nosys
387245	UNIMPL	NOHIDE	nosys
388246	UNIMPL	NOHIDE	nosys
389247	UNIMPL	NOHIDE	nosys
390248	UNIMPL	NOHIDE	nosys
391249	UNIMPL	NOHIDE	nosys
392; syscall numbers initially used in OpenBSD
393250	MSTD	BSD	{ int minherit(void *addr, size_t len, int inherit); }
394251	MSTD	BSD	{ int rfork(int flags); }
395252	MSTD	BSD	{ int openbsd_poll(struct pollfd *fds, u_int nfds, \
396			    int timeout); }
397253	STD	BSD	{ int issetugid(void); }
398254	STD	BSD	{ int lchown(char *path, int uid, int gid); }
399255	UNIMPL	NOHIDE	nosys
400256	UNIMPL	NOHIDE	nosys
401257	UNIMPL	NOHIDE	nosys
402258	UNIMPL	NOHIDE	nosys
403259	UNIMPL	NOHIDE	nosys
404260	UNIMPL	NOHIDE	nosys
405261	UNIMPL	NOHIDE	nosys
406262	UNIMPL	NOHIDE	nosys
407263	UNIMPL	NOHIDE	nosys
408264	UNIMPL	NOHIDE	nosys
409265	UNIMPL	NOHIDE	nosys
410266	UNIMPL	NOHIDE	nosys
411267	UNIMPL	NOHIDE	nosys
412268	UNIMPL	NOHIDE	nosys
413269	UNIMPL	NOHIDE	nosys
414270	UNIMPL	NOHIDE	nosys
415271	UNIMPL	NOHIDE	nosys
416272	STD	BSD	{ int getdents(int fd, char *buf, size_t count); }
417273	UNIMPL	NOHIDE	nosys
418274	STD	BSD	{ int lchmod(char *path, mode_t mode); }
419275	NOPROTO BSD	{ int lchown(char *path, uid_t uid, gid_t gid); } netbsd_lchown lchown_args int
420276	STD	BSD	{ int lutimes(char *path, struct timeval *tptr); }
421277	MNOPROTO BSD	{ int msync(void *addr, size_t len, int flags); } netbsd_msync msync_args int
422278	STD	BSD	{ int nstat(char *path, struct nstat *ub); }
423279	MSTD	BSD	{ int nfstat(int fd, struct nstat *sb); }
424280	STD	BSD	{ int nlstat(char *path, struct nstat *ub); }
425281	UNIMPL	NOHIDE	nosys
426282	UNIMPL	NOHIDE	nosys
427283	UNIMPL	NOHIDE	nosys
428284	UNIMPL	NOHIDE	nosys
429285	UNIMPL	NOHIDE	nosys
430286	UNIMPL	NOHIDE	nosys
431287	UNIMPL	NOHIDE	nosys
432288	UNIMPL	NOHIDE	nosys
433289	UNIMPL	NOHIDE	nosys
434290	UNIMPL	NOHIDE	nosys
435291	UNIMPL	NOHIDE	nosys
436292	UNIMPL	NOHIDE	nosys
437293	UNIMPL	NOHIDE	nosys
438294	UNIMPL	NOHIDE	nosys
439295	UNIMPL	NOHIDE	nosys
440296	UNIMPL	NOHIDE	nosys
441; XXX 297 is 300 in NetBSD 
442297	STD	BSD	{ int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }
443298	STD	BSD	{ int fhopen(const struct fhandle *u_fhp, int flags); }
444299	STD	BSD 	{ int fhstat(const struct fhandle *u_fhp, struct stat *sb); }
445; syscall numbers for FreeBSD
446300	MSTD	BSD	{ int modnext(int modid); }
447301	MSTD	BSD	{ int modstat(int modid, struct module_stat* stat); }
448302	MSTD	BSD	{ int modfnext(int modid); }
449303	MSTD	BSD	{ int modfind(const char *name); }
450304	MSTD	BSD	{ int kldload(const char *file); }
451305	MSTD	BSD	{ int kldunload(int fileid); }
452306	MSTD	BSD	{ int kldfind(const char *file); }
453307	MSTD	BSD	{ int kldnext(int fileid); }
454308	MSTD	BSD	{ int kldstat(int fileid, struct kld_file_stat* stat); }
455309	MSTD	BSD	{ int kldfirstmod(int fileid); }
456310	MSTD	BSD	{ int getsid(pid_t pid); }
457311	MSTD	BSD	{ int setresuid(uid_t ruid, uid_t euid, uid_t suid); }
458312	MSTD	BSD	{ int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }
459313	OBSOL	NOHIDE	signanosleep
460314     NOSTD   BSD     { int aio_return(struct aiocb *aiocbp); }
461315     NOSTD   BSD     { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }
462316     NOSTD   BSD     { int aio_cancel(int fd, struct aiocb *aiocbp); }
463317     NOSTD   BSD     { int aio_error(struct aiocb *aiocbp); }
464318     NOSTD   BSD     { int aio_read(struct aiocb *aiocbp); }
465319     NOSTD   BSD     { int aio_write(struct aiocb *aiocbp); }
466320     NOSTD   BSD     { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); }
467321     MSTD	BSD     { int yield(void); }
468322	OBSOL	NOHIDE	thr_sleep
469323	OBSOL	NOHIDE	thr_wakeup
470324     MSTD	BSD     { int mlockall(int how); }
471325     MSTD	BSD     { int munlockall(void); }
472326     STD     BSD     { int __getcwd(u_char *buf, u_int buflen); }
473
474327     MSTD     POSIX   { int sched_setparam (pid_t pid, const struct sched_param *param); }
475328     MSTD     POSIX   { int sched_getparam (pid_t pid, struct sched_param *param); }
476
477329     MSTD     POSIX   { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }
478330     MSTD     POSIX   { int sched_getscheduler (pid_t pid); }
479
480331     MSTD     POSIX   { int sched_yield (void); }
481332     MSTD     POSIX   { int sched_get_priority_max (int policy); }
482333     MSTD     POSIX   { int sched_get_priority_min (int policy); }
483334     MSTD     POSIX   { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }
484335	STD	BSD	{ int utrace(const void *addr, size_t len); }
485336	MCOMPAT4	BSD	{ int sendfile(int fd, int s, off_t offset, size_t nbytes, \
486				struct sf_hdtr *hdtr, off_t *sbytes, int flags); }
487337	STD	BSD	{ int kldsym(int fileid, int cmd, void *data); }
488338	MSTD	BSD	{ int jail(struct jail *jail); }
489339	UNIMPL	BSD	pioctl
490340	MSTD	POSIX	{ int sigprocmask(int how, const sigset_t *set, \
491			    sigset_t *oset); }
492341	MSTD	POSIX	{ int sigsuspend(const sigset_t *sigmask); }
493342	MSTD	POSIX	{ int sigaction(int sig, const struct sigaction *act, \
494			    struct sigaction *oact); }
495343	MSTD	POSIX	{ int sigpending(sigset_t *set); }
496344	MSTD	BSD	{ int sigreturn(const struct __ucontext *sigcntxp); }
497345	UNIMPL	NOHIDE	sigtimedwait
498346	UNIMPL	NOHIDE	sigwaitinfo
499347	MSTD	BSD	{ int __acl_get_file(const char *path, \
500			    acl_type_t type, struct acl *aclp); }
501348	MSTD	BSD	{ int __acl_set_file(const char *path, \
502			    acl_type_t type, struct acl *aclp); }
503349	MSTD	BSD	{ int __acl_get_fd(int filedes, acl_type_t type, \
504			    struct acl *aclp); }
505350	MSTD	BSD	{ int __acl_set_fd(int filedes, acl_type_t type, \
506			    struct acl *aclp); }
507351	MSTD	BSD	{ int __acl_delete_file(const char *path, \
508			    acl_type_t type); }
509352	MSTD	BSD	{ int __acl_delete_fd(int filedes, acl_type_t type); }
510353	MSTD	BSD	{ int __acl_aclcheck_file(const char *path, \
511			    acl_type_t type, struct acl *aclp); }
512354	MSTD	BSD	{ int __acl_aclcheck_fd(int filedes, acl_type_t type, \
513			    struct acl *aclp); }
514355	STD	BSD	{ int extattrctl(const char *path, int cmd, \
515			    const char *filename, int attrnamespace, \
516			    const char *attrname); }
517356	STD	BSD	{ int extattr_set_file(const char *path, \
518			    int attrnamespace, const char *attrname, \
519			    void *data, size_t nbytes); }
520357	STD	BSD	{ ssize_t extattr_get_file(const char *path, \
521			    int attrnamespace, const char *attrname, \
522			    void *data, size_t nbytes); }
523358	STD	BSD	{ int extattr_delete_file(const char *path, \
524			    int attrnamespace, const char *attrname); }
525359	NOSTD	BSD	{ int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); }
526360	MSTD	BSD	{ int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }
527361	MSTD	BSD	{ int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }
528362	MSTD	BSD	{ int kqueue(void); }
529363	MSTD	BSD	{ int kevent(int fd, \
530			    const struct kevent *changelist, int nchanges, \
531			    struct kevent *eventlist, int nevents, \
532			    const struct timespec *timeout); }
533364	UNIMPL	BSD	__cap_get_proc
534365	UNIMPL	BSD	__cap_set_proc
535366	UNIMPL	BSD	__cap_get_fd
536367	UNIMPL	BSD	__cap_get_file
537368	UNIMPL	BSD	__cap_set_fd
538369	UNIMPL	BSD	__cap_set_file
539370	NODEF	NOHIDE	lkmressys lkmressys nosys_args int
540371	STD	BSD	{ int extattr_set_fd(int fd, int attrnamespace, \
541			    const char *attrname, void *data, \
542			    size_t nbytes); }
543372	STD	BSD	{ ssize_t extattr_get_fd(int fd, int attrnamespace, \
544			    const char *attrname, void *data, size_t nbytes); }
545373	STD	BSD	{ int extattr_delete_fd(int fd, int attrnamespace, \
546			    const char *attrname); }
547374	MSTD	BSD	{ int __setugid(int flag); }
548375	NOIMPL	BSD	{ int nfsclnt(int flag, caddr_t argp); }
549376	STD	BSD	{ int eaccess(char *path, int flags); }
550377	UNIMPL	BSD	afs_syscall
551378	STD	BSD	{ int nmount(struct iovec *iovp, unsigned int iovcnt, \
552			    int flags); }
553379	STD	BSD	{ int kse_exit(void); }
554380	STD	BSD	{ int kse_wakeup(struct kse_mailbox *mbx); }
555381	STD	BSD	{ int kse_create(struct kse_mailbox *mbx, \
556			    int newgroup); }
557382	STD	BSD	{ int kse_thr_interrupt(struct kse_thr_mailbox *tmbx); }
558383	MSTD	BSD	{ int kse_release(void); }
559384	MSTD	BSD	{ int __mac_get_proc(struct mac *mac_p); }
560385	MSTD	BSD	{ int __mac_set_proc(struct mac *mac_p); }
561386	MSTD	BSD	{ int __mac_get_fd(int fd, struct mac *mac_p); }
562387	MSTD	BSD	{ int __mac_get_file(const char *path_p, \
563			    struct mac *mac_p); }
564388	MSTD	BSD	{ int __mac_set_fd(int fd, struct mac *mac_p); }
565389	MSTD	BSD	{ int __mac_set_file(const char *path_p, \
566			    struct mac *mac_p); }
567390	STD	BSD	{ int kenv(int what, const char *name, char *value, \
568			    int len); }
569391	STD	BSD	{ int lchflags(const char *path, int flags); }
570392	STD	BSD	{ int uuidgen(struct uuid *store, int count); }
571393	MSTD	BSD	{ int sendfile(int fd, int s, off_t offset, size_t nbytes, \
572				struct sf_hdtr *hdtr, off_t *sbytes, int flags); }
573394	MSTD	BSD	{ int mac_syscall(const char *policy, int call, \
574				void *arg); }
575395	UNIMPL	NOHIDE	nosys
576396	UNIMPL	NOHIDE	nosys
577397	UNIMPL	NOHIDE	nosys
578398	UNIMPL	NOHIDE	nosys
579399	UNIMPL	NOHIDE	nosys
580400	MNOSTD	BSD	{ int ksem_close(semid_t id); }
581401	MNOSTD	BSD	{ int ksem_post(semid_t id); }
582402	MNOSTD	BSD	{ int ksem_wait(semid_t id); }
583403	MNOSTD	BSD	{ int ksem_trywait(semid_t id); }
584404	MNOSTD	BSD	{ int ksem_init(semid_t *idp, unsigned int value); }
585405	MNOSTD	BSD	{ int ksem_open(semid_t *idp, const char *name, \
586				int oflag, mode_t mode, unsigned int value); }
587406	MNOSTD	BSD	{ int ksem_unlink(const char *name); }
588407	MNOSTD	BSD	{ int ksem_getvalue(semid_t id, int *val); }
589408	MNOSTD	BSD	{ int ksem_destroy(semid_t id); }
590409	UNIMPL	BSD	__mac_get_pid
591410	UNIMPL	BSD	__mac_get_link
592411	UNIMPL	BSD	__mac_set_link
593412	STD	BSD	{ int extattr_set_link(const char *path, \
594			    int attrnamespace, const char *attrname, \
595			    void *data, size_t nbytes); }
596413	STD	BSD	{ ssize_t extattr_get_link(const char *path, \
597			    int attrnamespace, const char *attrname, \
598			    void *data, size_t nbytes); }
599414	STD	BSD	{ int extattr_delete_link(const char *path, \
600			    int attrnamespace, const char *attrname); }
601415	UNIMPL	BSD	__execve_mac
602
603; Please copy any additions and changes to the following compatability tables:
604; sys/ia64/ia32/syscalls.master  (take a best guess)
605; [other 64 bit platforms with an alternate 32 bit syscall table go here too]
606