syscalls.master revision 1.177
1	$NetBSD: syscalls.master,v 1.177 2007/09/07 18:56:09 rmind 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; An optional field, MPSAFE, after the type field, indicates that
14; the system call is MP-safe.
15;
16; types:
17;	STD	always included
18;	OBSOL	obsolete, not included in system
19;	UNIMPL	unimplemented, not included in system
20;	EXCL	implemented, but not included in system
21;	NODEF	included, but don't define the syscall number
22;	NOARGS	included, but don't define the syscall args structure
23;	INDIR	included, but don't define the syscall args structure,
24;		and allow it to be "really" varargs.
25;
26; The compat options are defined in the syscalls.conf file, and the
27; compat option name is prefixed to the syscall name.  Other than
28; that, they're like NODEF (for 'compat' options), or STD (for
29; 'libcompat' options).
30;
31; The type-dependent arguments are as follows:
32; For STD, NODEF, NOARGS, and compat syscalls:
33;	{ pseudo-proto } [alias]
34; For other syscalls:
35;	[comment]
36;
37; #ifdef's, etc. may be included, and are copied to the output files.
38; #include's are copied to the syscall names and switch definition files only.
39
40#include "opt_nfsserver.h"
41#include "opt_ntp.h"
42#include "opt_compat_netbsd.h"
43#include "opt_sysv.h"
44#include "opt_compat_43.h"
45#include "opt_posix.h"
46
47#include "fs_lfs.h"
48#include "fs_nfs.h"
49
50#include <sys/param.h>
51#include <sys/systm.h>
52#include <sys/signal.h>
53#include <sys/mount.h>
54#include <sys/syscallargs.h>
55
56%%
57
58; Reserved/unimplemented system calls in the range 0-150 inclusive
59; are reserved for use in future Berkeley releases.
60; Additional system calls implemented in vendor and other
61; redistributions should be placed in the reserved range at the end
62; of the current calls.
63
640	INDIR		{ int sys_syscall(int number, ...); }
651	STD		{ void sys_exit(int rval); }
662	STD		{ int sys_fork(void); }
673	STD		{ ssize_t sys_read(int fd, void *buf, size_t nbyte); }
684	STD		{ ssize_t sys_write(int fd, const void *buf, \
69			    size_t nbyte); }
705	STD		{ int sys_open(const char *path, \
71			    int flags, ... mode_t mode); }
726	STD		{ int sys_close(int fd); }
737	STD 		{ int sys_wait4(int pid, int *status, int options, \
74			    struct rusage *rusage); }
758	COMPAT_43	{ int sys_creat(const char *path, mode_t mode); } ocreat
769	STD		{ int sys_link(const char *path, const char *link); }
7710	STD		{ int sys_unlink(const char *path); }
7811	OBSOL		execv
7912	STD		{ int sys_chdir(const char *path); }
8013	STD		{ int sys_fchdir(int fd); }
8114	STD		{ int sys_mknod(const char *path, mode_t mode, \
82			    dev_t dev); }
8315	STD		{ int sys_chmod(const char *path, mode_t mode); }
8416	STD		{ int sys_chown(const char *path, uid_t uid, \
85			    gid_t gid); }
8617	STD		{ int sys_obreak(char *nsize); } break
8718	COMPAT_20	{ int sys_getfsstat(struct statfs12 *buf, \
88			    long bufsize, int flags); }
8919	COMPAT_43	{ long sys_lseek(int fd, long offset, int whence); } \
90			    olseek
91#ifdef COMPAT_43
9220	STD MPSAFE	{ pid_t sys_getpid_with_ppid(void); } getpid
93#else
9420	STD MPSAFE	{ pid_t sys_getpid(void); }
95#endif
9621	COMPAT_40	{ int sys_mount(const char *type, const char *path, \
97			    int flags, void *data); }
9822	STD		{ int sys_unmount(const char *path, int flags); }
9923	STD 		{ int sys_setuid(uid_t uid); }
100#ifdef COMPAT_43
10124	STD		{ uid_t sys_getuid_with_euid(void); } getuid
102#else
10324	STD MPSAFE	{ uid_t sys_getuid(void); }
104#endif
10525	STD MPSAFE	{ uid_t sys_geteuid(void); }
10626	STD		{ int sys_ptrace(int req, pid_t pid, void *addr, \
107			    int data); }
10827	STD		{ ssize_t sys_recvmsg(int s, struct msghdr *msg, \
109			    int flags); }
11028	STD		{ ssize_t sys_sendmsg(int s, \
111			    const struct msghdr *msg, int flags); }
11229	STD		{ ssize_t sys_recvfrom(int s, void *buf, size_t len, \
113			    int flags, struct sockaddr *from, \
114			    unsigned int *fromlenaddr); }
11530	STD		{ int sys_accept(int s, struct sockaddr *name, \
116			    unsigned int *anamelen); }
11731	STD		{ int sys_getpeername(int fdes, struct sockaddr *asa, \
118			    unsigned int *alen); }
11932	STD		{ int sys_getsockname(int fdes, struct sockaddr *asa, \
120			    unsigned int *alen); }
12133	STD		{ int sys_access(const char *path, int flags); }
12234	STD		{ int sys_chflags(const char *path, u_long flags); }
12335	STD		{ int sys_fchflags(int fd, u_long flags); }
12436	STD		{ void sys_sync(void); }
12537	STD 		{ int sys_kill(int pid, int signum); }
12638	COMPAT_43	{ int sys_stat(const char *path, struct stat43 *ub); } \
127			    stat43
12839	STD MPSAFE	{ pid_t sys_getppid(void); }
12940	COMPAT_43	{ int sys_lstat(const char *path, \
130			    struct stat43 *ub); } lstat43
13141	STD		{ int sys_dup(int fd); }
13242	STD		{ int sys_pipe(void); }
13343	STD MPSAFE	{ gid_t sys_getegid(void); }
13444	STD MPSAFE	{ int sys_profil(char *samples, size_t size, \
135			    u_long offset, u_int scale); }
13645	STD		{ int sys_ktrace(const char *fname, int ops, \
137			    int facs, int pid); }
13846	COMPAT_13 MPSAFE	{ int sys_sigaction(int signum, \
139			    const struct sigaction13 *nsa, \
140			    struct sigaction13 *osa); } sigaction13
141#ifdef COMPAT_43
14247	STD MPSAFE	{ gid_t sys_getgid_with_egid(void); } getgid
143#else
14447	STD MPSAFE	{ gid_t sys_getgid(void); }
145#endif
14648	COMPAT_13 MPSAFE	{ int sys_sigprocmask(int how, \
147			    int mask); } sigprocmask13
14849	STD MPSAFE	{ int sys___getlogin(char *namebuf, size_t namelen); }
14950	STD	 	{ int sys___setlogin(const char *namebuf); }
15051	STD		{ int sys_acct(const char *path); }
15152	COMPAT_13 MPSAFE	{ int sys_sigpending(void); } sigpending13
15253	COMPAT_13 MPSAFE	{ int sys_sigaltstack( \
153			    const struct sigaltstack13 *nss, \
154			    struct sigaltstack13 *oss); } sigaltstack13
15554	STD		{ int sys_ioctl(int fd, \
156			    u_long com, ... void *data); }
15755	COMPAT_12	{ int sys_reboot(int opt); } oreboot
15856	STD		{ int sys_revoke(const char *path); }
15957	STD		{ int sys_symlink(const char *path, \
160			    const char *link); }
16158	STD		{ ssize_t sys_readlink(const char *path, char *buf, \
162			    size_t count); }
16359	STD		{ int sys_execve(const char *path, \
164			    char * const *argp, char * const *envp); }
16560	STD		{ mode_t sys_umask(mode_t newmask); }
16661	STD		{ int sys_chroot(const char *path); }
16762	COMPAT_43	{ int sys_fstat(int fd, struct stat43 *sb); } fstat43
16863	COMPAT_43	{ int sys_getkerninfo(int op, char *where, int *size, \
169			    int arg); } ogetkerninfo
17064	COMPAT_43	{ int sys_getpagesize(void); } ogetpagesize
17165	COMPAT_12	{ int sys_msync(void *addr, size_t len); }
172; XXX COMPAT_??? for 4.4BSD-compatible vfork(2)?
17366	STD		{ int sys_vfork(void); }
17467	OBSOL		vread
17568	OBSOL		vwrite
17669	STD		{ int sys_sbrk(intptr_t incr); }
17770	STD		{ int sys_sstk(int incr); }
17871	COMPAT_43	{ int sys_mmap(void *addr, size_t len, int prot, \
179			    int flags, int fd, long pos); } ommap
18072	STD		{ int sys_ovadvise(int anom); } vadvise
18173	STD		{ int sys_munmap(void *addr, size_t len); }
18274	STD		{ int sys_mprotect(void *addr, size_t len, \
183			    int prot); }
18475	STD		{ int sys_madvise(void *addr, size_t len, \
185			    int behav); }
18676	OBSOL		vhangup
18777	OBSOL		vlimit
18878	STD		{ int sys_mincore(void *addr, size_t len, \
189			    char *vec); }
19079	STD MPSAFE	{ int sys_getgroups(int gidsetsize, \
191			    gid_t *gidset); }
19280	STD		{ int sys_setgroups(int gidsetsize, \
193			    const gid_t *gidset); }
19481	STD MPSAFE 	{ int sys_getpgrp(void); }
19582	STD 		{ int sys_setpgid(int pid, int pgid); }
19683	STD		{ int sys_setitimer(int which, \
197			    const struct itimerval *itv, \
198			    struct itimerval *oitv); }
19984	COMPAT_43 	{ int sys_wait(void); } owait
20085	COMPAT_12	{ int sys_swapon(const char *name); } oswapon
20186	STD		{ int sys_getitimer(int which, \
202			    struct itimerval *itv); }
20387	COMPAT_43	{ int sys_gethostname(char *hostname, u_int len); } \
204			    ogethostname
20588	COMPAT_43	{ int sys_sethostname(char *hostname, u_int len); } \
206			    osethostname
20789	COMPAT_43	{ int sys_getdtablesize(void); } ogetdtablesize
20890	STD		{ int sys_dup2(int from, int to); }
20991	UNIMPL		getdopt
21092	STD		{ int sys_fcntl(int fd, int cmd, ... void *arg); }
21193	STD		{ int sys_select(int nd, fd_set *in, fd_set *ou, \
212			    fd_set *ex, struct timeval *tv); }
21394	UNIMPL		setdopt
21495	STD		{ int sys_fsync(int fd); }
21596	STD MPSAFE	{ int sys_setpriority(int which, id_t who, int prio); }
21697	COMPAT_30	{ int sys_socket(int domain, int type, int protocol); }
21798	STD		{ int sys_connect(int s, const struct sockaddr *name, \
218			    unsigned int namelen); }
21999	COMPAT_43	{ int sys_accept(int s, void *name, \
220			    int *anamelen); } oaccept
221100	STD MPSAFE	{ int sys_getpriority(int which, id_t who); }
222101	COMPAT_43	{ int sys_send(int s, void *buf, int len, \
223			    int flags); } osend
224102	COMPAT_43	{ int sys_recv(int s, void *buf, int len, \
225			    int flags); } orecv
226103	COMPAT_13 MPSAFE	{ int sys_sigreturn(struct sigcontext13 *sigcntxp); } \
227			    sigreturn13
228104	STD		{ int sys_bind(int s, const struct sockaddr *name, \
229			    unsigned int namelen); }
230105	STD		{ int sys_setsockopt(int s, int level, int name, \
231			    const void *val, unsigned int valsize); }
232106	STD		{ int sys_listen(int s, int backlog); }
233107	OBSOL		vtimes
234108	COMPAT_43 MPSAFE	{ int sys_sigvec(int signum, struct sigvec *nsv, \
235			    struct sigvec *osv); } osigvec
236109	COMPAT_43 MPSAFE	{ int sys_sigblock(int mask); } osigblock
237110	COMPAT_43 MPSAFE	{ int sys_sigsetmask(int mask); } osigsetmask
238111	COMPAT_13 MPSAFE	{ int sys_sigsuspend(int mask); } sigsuspend13
239112	COMPAT_43 MPSAFE	{ int sys_sigstack(struct sigstack *nss, \
240			    struct sigstack *oss); } osigstack
241113	COMPAT_43	{ int sys_recvmsg(int s, struct omsghdr *msg, \
242			    int flags); } orecvmsg
243114	COMPAT_43	{ int sys_sendmsg(int s, void *msg, int flags); } \
244			    osendmsg
245115	OBSOL		vtrace
246116	STD MPSAFE	{ int sys_gettimeofday(struct timeval *tp, \
247			    void *tzp); }
248117	STD MPSAFE	{ int sys_getrusage(int who, struct rusage *rusage); }
249118	STD		{ int sys_getsockopt(int s, int level, int name, \
250			    void *val, unsigned int *avalsize); }
251119	OBSOL		resuba
252120	STD		{ ssize_t sys_readv(int fd, \
253			    const struct iovec *iovp, int iovcnt); }
254121	STD		{ ssize_t sys_writev(int fd, \
255			    const struct iovec *iovp, int iovcnt); }
256122	STD		{ int sys_settimeofday(const struct timeval *tv, \
257			    const void *tzp); }
258123	STD		{ int sys_fchown(int fd, uid_t uid, gid_t gid); }
259124	STD		{ int sys_fchmod(int fd, mode_t mode); }
260125	COMPAT_43	{ int sys_recvfrom(int s, void *buf, size_t len, \
261			    int flags, void *from, int *fromlenaddr); } \
262			    orecvfrom
263126	STD		{ int sys_setreuid(uid_t ruid, uid_t euid); }
264127	STD		{ int sys_setregid(gid_t rgid, gid_t egid); }
265128	STD		{ int sys_rename(const char *from, const char *to); }
266129	COMPAT_43	{ int sys_truncate(const char *path, long length); } \
267			    otruncate
268130	COMPAT_43	{ int sys_ftruncate(int fd, long length); } oftruncate
269131	STD		{ int sys_flock(int fd, int how); }
270132	STD		{ int sys_mkfifo(const char *path, mode_t mode); }
271133	STD		{ ssize_t sys_sendto(int s, const void *buf, \
272			    size_t len, int flags, const struct sockaddr *to, \
273			    unsigned int tolen); }
274134	STD		{ int sys_shutdown(int s, int how); }
275135	STD		{ int sys_socketpair(int domain, int type, \
276			    int protocol, int *rsv); }
277136	STD		{ int sys_mkdir(const char *path, mode_t mode); }
278137	STD		{ int sys_rmdir(const char *path); }
279138	STD		{ int sys_utimes(const char *path, \
280			    const struct timeval *tptr); }
281139	OBSOL		4.2 sigreturn
282140	STD		{ int sys_adjtime(const struct timeval *delta, \
283			    struct timeval *olddelta); }
284141	COMPAT_43	{ int sys_getpeername(int fdes, void *asa, \
285			    int *alen); } ogetpeername
286142	COMPAT_43	{ int32_t sys_gethostid(void); } ogethostid
287143	COMPAT_43	{ int sys_sethostid(int32_t hostid); } osethostid
288144	COMPAT_43 MPSAFE	{ int sys_getrlimit(int which, \
289			    struct orlimit *rlp); } ogetrlimit
290145	COMPAT_43	{ int sys_setrlimit(int which, \
291			    const struct orlimit *rlp); } osetrlimit
292146	COMPAT_43	{ int sys_killpg(int pgid, int signum); } okillpg
293147	STD	 	{ int sys_setsid(void); }
294148	STD		{ int sys_quotactl(const char *path, int cmd, \
295			    int uid, void *arg); }
296149	COMPAT_43	{ int sys_quota(void); } oquota
297150	COMPAT_43	{ int sys_getsockname(int fdec, void *asa, \
298			    int *alen); } ogetsockname
299
300; Syscalls 151-180 inclusive are reserved for vendor-specific
301; system calls.  (This includes various calls added for compatibity
302; with other Unix variants.)
303; Some of these calls are now supported by BSD...
304151	UNIMPL
305152	UNIMPL
306153	UNIMPL
307154	UNIMPL
308#if defined(NFS) || defined(NFSSERVER) || !defined(_KERNEL)
309155	STD		{ int sys_nfssvc(int flag, void *argp); }
310#else
311155	EXCL		nfssvc
312#endif
313156	COMPAT_43	{ int sys_getdirentries(int fd, char *buf, \
314			    u_int count, long *basep); } ogetdirentries
315157	COMPAT_20	{ int sys_statfs(const char *path, \
316			    struct statfs12 *buf); }
317158	COMPAT_20	{ int sys_fstatfs(int fd, struct statfs12 *buf); }
318159	UNIMPL
319160	UNIMPL
320161	COMPAT_30	{ int sys_getfh(const char *fname, \
321			    struct compat_30_fhandle *fhp); }
322162	COMPAT_09	{ int sys_getdomainname(char *domainname, int len); } \
323			    ogetdomainname
324163	COMPAT_09	{ int sys_setdomainname(char *domainname, int len); } \
325			    osetdomainname
326164	COMPAT_09	{ int sys_uname(struct outsname *name); } ouname
327165	STD		{ int sys_sysarch(int op, void *parms); }
328166	UNIMPL
329167	UNIMPL
330168	UNIMPL
331; XXX more generally, never on machines where sizeof(void *) != sizeof(int)
332#if (defined(SYSVSEM) || !defined(_KERNEL)) && !defined(_LP64)
333169	COMPAT_10 MPSAFE	{ int sys_semsys(int which, int a2, int a3, int a4, \
334			    int a5); } osemsys
335#else
336169	EXCL		1.0 semsys
337#endif
338; XXX more generally, never on machines where sizeof(void *) != sizeof(int)
339#if (defined(SYSVMSG) || !defined(_KERNEL)) && !defined(_LP64)
340170	COMPAT_10	{ int sys_msgsys(int which, int a2, int a3, int a4, \
341			    int a5, int a6); } omsgsys
342#else
343170	EXCL		1.0 msgsys
344#endif
345; XXX more generally, never on machines where sizeof(void *) != sizeof(int)
346#if (defined(SYSVSHM) || !defined(_KERNEL)) && !defined(_LP64)
347171	COMPAT_10	{ int sys_shmsys(int which, int a2, int a3, int a4); } \
348			    oshmsys
349#else
350171	EXCL		1.0 shmsys
351#endif
352172	UNIMPL
353173	STD		{ ssize_t sys_pread(int fd, void *buf, \
354			    size_t nbyte, int pad, off_t offset); }
355174	STD		{ ssize_t sys_pwrite(int fd, const void *buf, \
356			    size_t nbyte, int pad, off_t offset); }
357; For some reason, ntp_gettime doesn't want to raise SIGSYS when it's excluded.
358175	COMPAT_30	{ int sys_ntp_gettime(struct ntptimeval30 *ntvp); }
359#if defined(NTP) || !defined(_KERNEL)
360176	STD		{ int sys_ntp_adjtime(struct timex *tp); }
361#else
362176	EXCL		ntp_adjtime
363#endif
364177	UNIMPL
365178	UNIMPL
366179	UNIMPL
367180	UNIMPL
368
369; Syscalls 180-199 are used by/reserved for BSD
370181	STD		{ int sys_setgid(gid_t gid); }
371182	STD 		{ int sys_setegid(gid_t egid); }
372183	STD		{ int sys_seteuid(uid_t euid); }
373#if defined(LFS) || !defined(_KERNEL)
374184	STD		{ int sys_lfs_bmapv(fsid_t *fsidp, \
375			    struct block_info *blkiov, int blkcnt); }
376185	STD		{ int sys_lfs_markv(fsid_t *fsidp, \
377			    struct block_info *blkiov, int blkcnt); }
378186	STD		{ int sys_lfs_segclean(fsid_t *fsidp, u_long segment); }
379187	STD		{ int sys_lfs_segwait(fsid_t *fsidp, \
380			    struct timeval *tv); }
381#else
382184	EXCL		lfs_bmapv
383185	EXCL		lfs_markv
384186	EXCL		lfs_segclean
385187	EXCL		lfs_segwait
386#endif
387188	COMPAT_12	{ int sys_stat(const char *path, struct stat12 *ub); } \
388			    stat12
389189	COMPAT_12	{ int sys_fstat(int fd, struct stat12 *sb); } fstat12
390190	COMPAT_12	{ int sys_lstat(const char *path, \
391			    struct stat12 *ub); } lstat12
392191	STD		{ long sys_pathconf(const char *path, int name); }
393192	STD		{ long sys_fpathconf(int fd, int name); }
394193	UNIMPL
395194	STD		{ int sys_getrlimit(int which, \
396			    struct rlimit *rlp); }
397195	STD		{ int sys_setrlimit(int which, \
398			    const struct rlimit *rlp); }
399196	COMPAT_12	{ int sys_getdirentries(int fd, char *buf, \
400			    u_int count, long *basep); }
401197	STD		{ void *sys_mmap(void *addr, size_t len, int prot, \
402			    int flags, int fd, long pad, off_t pos); }
403198	INDIR		{ quad_t sys___syscall(quad_t num, ...); }
404199	STD		{ off_t sys_lseek(int fd, int pad, off_t offset, \
405			    int whence); }
406200	STD		{ int sys_truncate(const char *path, int pad, \
407			    off_t length); }
408201	STD		{ int sys_ftruncate(int fd, int pad, off_t length); }
409202	STD		{ int sys___sysctl(const int *name, u_int namelen, \
410			    void *old, size_t *oldlenp, const void *new, \
411			    size_t newlen); }
412203	STD		{ int sys_mlock(const void *addr, size_t len); }
413204	STD		{ int sys_munlock(const void *addr, size_t len); }
414205	STD		{ int sys_undelete(const char *path); }
415206	STD		{ int sys_futimes(int fd, \
416			    const struct timeval *tptr); }
417207	STD MPSAFE	{ pid_t sys_getpgid(pid_t pid); }
418208	STD		{ int sys_reboot(int opt, char *bootstr); }
419209	STD		{ int sys_poll(struct pollfd *fds, u_int nfds, \
420			    int timeout); }
421;
422; Syscalls 210-219 are reserved for dynamically loaded syscalls
423;
424#if defined(LKM) || !defined(_KERNEL)
425210	NODEF		{ int sys_lkmnosys(void); }
426211	NODEF		{ int sys_lkmnosys(void); }
427212	NODEF		{ int sys_lkmnosys(void); }
428213	NODEF		{ int sys_lkmnosys(void); }
429214	NODEF		{ int sys_lkmnosys(void); }
430215	NODEF		{ int sys_lkmnosys(void); }
431216	NODEF		{ int sys_lkmnosys(void); }
432217	NODEF		{ int sys_lkmnosys(void); }
433218	NODEF		{ int sys_lkmnosys(void); }
434219	NODEF		{ int sys_lkmnosys(void); }
435#else	/* !LKM */
436210	EXCL		lkmnosys
437211	EXCL		lkmnosys
438212	EXCL		lkmnosys
439213	EXCL		lkmnosys
440214	EXCL		lkmnosys
441215	EXCL		lkmnosys
442216	EXCL		lkmnosys
443217	EXCL		lkmnosys
444218	EXCL		lkmnosys
445219	EXCL		lkmnosys
446#endif	/* !LKM */
447; System calls 220-300 are reserved for use by NetBSD
448#if defined(SYSVSEM) || !defined(_KERNEL)
449220	COMPAT_14 MPSAFE	{ int sys___semctl(int semid, int semnum, int cmd, \
450			    union __semun *arg); }
451221	STD MPSAFE	{ int sys_semget(key_t key, int nsems, int semflg); }
452222	STD MPSAFE	{ int sys_semop(int semid, struct sembuf *sops, \
453			    size_t nsops); }
454223	STD MPSAFE	{ int sys_semconfig(int flag); }
455#else
456220	EXCL		compat_14_semctl
457221	EXCL		semget
458222	EXCL		semop
459223	EXCL		semconfig
460#endif
461#if defined(SYSVMSG) || !defined(_KERNEL)
462224	COMPAT_14 MPSAFE { int sys_msgctl(int msqid, int cmd, \
463			    struct msqid_ds14 *buf); }
464225	STD MPSAFE	{ int sys_msgget(key_t key, int msgflg); }
465226	STD MPSAFE	{ int sys_msgsnd(int msqid, const void *msgp, \
466			    size_t msgsz, int msgflg); }
467227	STD MPSAFE	{ ssize_t sys_msgrcv(int msqid, void *msgp, \
468			    size_t msgsz, long msgtyp, int msgflg); }
469#else
470224	EXCL 		compat_14_msgctl
471225	EXCL 		msgget
472226	EXCL 		msgsnd
473227	EXCL 		msgrcv
474#endif
475#if defined(SYSVSHM) || !defined(_KERNEL)
476228	STD		{ void *sys_shmat(int shmid, const void *shmaddr, \
477			    int shmflg); }
478229	COMPAT_14	{ int sys_shmctl(int shmid, int cmd, \
479			    struct shmid_ds14 *buf); }
480230	STD		{ int sys_shmdt(const void *shmaddr); }
481231	STD		{ int sys_shmget(key_t key, size_t size, int shmflg); }
482#else
483228	EXCL		shmat
484229	EXCL		compat_14_shmctl
485230	EXCL		shmdt
486231	EXCL		shmget
487#endif
488232	STD MPSAFE	{ int sys_clock_gettime(clockid_t clock_id, \
489			    struct timespec *tp); }
490233	STD		{ int sys_clock_settime(clockid_t clock_id, \
491			    const struct timespec *tp); }
492234	STD MPSAFE	{ int sys_clock_getres(clockid_t clock_id, \
493			    struct timespec *tp); }
494235	STD		{ int sys_timer_create(clockid_t clock_id, \
495			    struct sigevent *evp, timer_t *timerid); }
496236	STD		{ int sys_timer_delete(timer_t timerid); }
497237	STD		{ int sys_timer_settime(timer_t timerid, int flags, \
498			    const struct itimerspec *value, \
499			    struct itimerspec *ovalue); }
500238	STD		{ int sys_timer_gettime(timer_t timerid, struct \
501			    itimerspec *value); }
502239	STD		{ int sys_timer_getoverrun(timer_t timerid); }
503;
504; Syscalls 240-269 are reserved for other IEEE Std1003.1b syscalls
505;
506240	STD MPSAFE	{ int sys_nanosleep(const struct timespec *rqtp, \
507			    struct timespec *rmtp); }
508241	STD		{ int sys_fdatasync(int fd); }
509242	STD		{ int sys_mlockall(int flags); }
510243	STD		{ int sys_munlockall(void); }
511244	STD MPSAFE	{ int sys___sigtimedwait(const sigset_t *set, \
512			    siginfo_t *info, \
513			    struct timespec *timeout); }
514245	UNIMPL		sys_sigqueue
515;
516; Syscall 246 is free for any use
517;
518246	UNIMPL
519#if defined(P1003_1B_SEMAPHORE) || (!defined(_KERNEL) && defined(_LIBC))
520247	STD		{ int sys__ksem_init(unsigned int value, semid_t *idp); }
521248	STD		{ int sys__ksem_open(const char *name, int oflag, \
522			    mode_t mode, unsigned int value, semid_t *idp); }
523249	STD 		{ int sys__ksem_unlink(const char *name); }
524250	STD		{ int sys__ksem_close(semid_t id); }
525251	STD 		{ int sys__ksem_post(semid_t id); }
526252	STD 		{ int sys__ksem_wait(semid_t id); }
527253	STD 		{ int sys__ksem_trywait(semid_t id); }
528254	STD 		{ int sys__ksem_getvalue(semid_t id, \
529			    unsigned int *value); }
530255	STD		{ int sys__ksem_destroy(semid_t id); }
531256	UNIMPL		sys__ksem_timedwait
532#else
533247	EXCL		sys__ksem_init
534248	EXCL		sys__ksem_open
535249	EXCL 		sys__ksem_unlink
536250	EXCL		sys__ksem_close
537251	EXCL		sys__ksem_post
538252	EXCL		sys__ksem_wait
539253	EXCL		sys__ksem_trywait
540254	EXCL		sys__ksem_getvalue
541255	EXCL		sys__ksem_destroy
542256	UNIMPL		sys__ksem_timedwait
543#endif
544257	STD		{ mqd_t sys_mq_open(const char * name, int oflag, \
545			    mode_t mode, struct mq_attr *attr); }
546258	STD		{ int sys_mq_close(mqd_t mqdes); }
547259	STD		{ int sys_mq_unlink(const char *name); }
548260	STD		{ int sys_mq_getattr(mqd_t mqdes, \
549			    struct mq_attr *mqstat); }
550261	STD		{ int sys_mq_setattr(mqd_t mqdes, \
551			    const struct mq_attr *mqstat, \
552			    struct mq_attr *omqstat); }
553262	STD		{ int sys_mq_notify(mqd_t mqdes, \
554			    const struct sigevent *notification); }
555263	STD		{ int sys_mq_send(mqd_t mqdes, const char *msg_ptr, \
556			    size_t msg_len, unsigned msg_prio); }
557264	STD		{ ssize_t sys_mq_receive(mqd_t mqdes, char *msg_ptr, \
558			    size_t msg_len, unsigned *msg_prio); }
559265	STD		{ int sys_mq_timedsend(mqd_t mqdes, \
560			    const char *msg_ptr, size_t msg_len, \
561			    unsigned msg_prio, \
562			    const struct timespec *abs_timeout); }
563266	STD		{ ssize_t sys_mq_timedreceive(mqd_t mqdes, \
564			    char *msg_ptr, size_t msg_len, unsigned *msg_prio, \
565			    const struct timespec *abs_timeout); }
566267	UNIMPL
567268	UNIMPL
568269	UNIMPL
569270	STD		{ int sys___posix_rename(const char *from, \
570			    const char *to); }
571271	STD		{ int sys_swapctl(int cmd, void *arg, int misc); }
572272	COMPAT_30	{ int sys_getdents(int fd, char *buf, size_t count); }
573273	STD		{ int sys_minherit(void *addr, size_t len, \
574			    int inherit); }
575274	STD		{ int sys_lchmod(const char *path, mode_t mode); }
576275	STD		{ int sys_lchown(const char *path, uid_t uid, \
577			    gid_t gid); }
578276	STD		{ int sys_lutimes(const char *path, \
579			    const struct timeval *tptr); }
580277	STD		{ int sys___msync13(void *addr, size_t len, int flags); }
581278	COMPAT_30	{ int sys___stat13(const char *path, struct stat13 *ub); }
582279	COMPAT_30	{ int sys___fstat13(int fd, struct stat13 *sb); }
583280	COMPAT_30	{ int sys___lstat13(const char *path, struct stat13 *ub); }
584281	STD MPSAFE	{ int sys___sigaltstack14( \
585			    const struct sigaltstack *nss, \
586			    struct sigaltstack *oss); }
587282	STD		{ int sys___vfork14(void); }
588283	STD		{ int sys___posix_chown(const char *path, uid_t uid, \
589			    gid_t gid); }
590284	STD		{ int sys___posix_fchown(int fd, uid_t uid, \
591			    gid_t gid); }
592285	STD		{ int sys___posix_lchown(const char *path, uid_t uid, \
593			    gid_t gid); }
594286	STD MPSAFE	{ pid_t sys_getsid(pid_t pid); }
595287	STD		{ pid_t sys___clone(int flags, void *stack); }
596288	STD		{ int sys_fktrace(const int fd, int ops, \
597			    int facs, int pid); }
598289	STD		{ ssize_t sys_preadv(int fd, \
599			    const struct iovec *iovp, int iovcnt, \
600			    int pad, off_t offset); }
601290	STD		{ ssize_t sys_pwritev(int fd, \
602			    const struct iovec *iovp, int iovcnt, \
603			    int pad, off_t offset); }
604291	COMPAT_16 MPSAFE	{ int sys___sigaction14(int signum, \
605			    const struct sigaction *nsa, \
606			    struct sigaction *osa); }
607292	STD MPSAFE	{ int sys___sigpending14(sigset_t *set); }
608293	STD MPSAFE	{ int sys___sigprocmask14(int how, \
609			    const sigset_t *set, \
610			    sigset_t *oset); }
611294	STD MPSAFE	{ int sys___sigsuspend14(const sigset_t *set); }
612295	COMPAT_16 MPSAFE { int sys___sigreturn14(struct sigcontext *sigcntxp); }
613296	STD		{ int sys___getcwd(char *bufp, size_t length); }
614297	STD		{ int sys_fchroot(int fd); }
615298	COMPAT_30	{ int sys_fhopen(const struct compat_30_fhandle *fhp, int flags); }
616299	COMPAT_30	{ int sys_fhstat(const struct compat_30_fhandle *fhp, \
617			    struct stat13 *sb); }
618300	COMPAT_20	{ int sys_fhstatfs(const struct compat_30_fhandle *fhp, \
619			    struct statfs12 *buf); }
620#if defined(SYSVSEM) || !defined(_KERNEL)
621301	STD MPSAFE	{ int sys_____semctl13(int semid, int semnum, int cmd, \
622			    ... union __semun *arg); }
623#else
624301	EXCL		____semctl13
625#endif
626#if defined(SYSVMSG) || !defined(_KERNEL)
627302	STD MPSAFE	{ int sys___msgctl13(int msqid, int cmd, \
628			    struct msqid_ds *buf); }
629#else
630302	EXCL		__msgctl13
631#endif
632#if defined(SYSVSHM) || !defined(_KERNEL)
633303	STD 		{ int sys___shmctl13(int shmid, int cmd, \
634			    struct shmid_ds *buf); }
635#else
636303	EXCL		__shmctl13
637#endif
638304	STD		{ int sys_lchflags(const char *path, u_long flags); }
639305	STD MPSAFE	{ int sys_issetugid(void); }
640306	STD MPSAFE	{ int sys_utrace(const char *label, void *addr, \
641				size_t len); }
642307	STD MPSAFE	{ int sys_getcontext(struct __ucontext *ucp); }
643308	STD MPSAFE	{ int sys_setcontext(const struct __ucontext *ucp); }
644309	STD		{ int sys__lwp_create(const struct __ucontext *ucp, \
645				u_long flags, lwpid_t *new_lwp); }
646310	STD		{ int sys__lwp_exit(void); }
647311	STD MPSAFE	{ lwpid_t sys__lwp_self(void); }
648312	STD MPSAFE	{ int sys__lwp_wait(lwpid_t wait_for, \
649				lwpid_t *departed); }
650313	STD MPSAFE	{ int sys__lwp_suspend(lwpid_t target); }
651314	STD MPSAFE	{ int sys__lwp_continue(lwpid_t target); }
652315	STD MPSAFE	{ int sys__lwp_wakeup(lwpid_t target); }
653316	STD MPSAFE	{ void *sys__lwp_getprivate(void); }
654317	STD MPSAFE	{ void sys__lwp_setprivate(void *ptr); }
655318	STD		{ int sys__lwp_kill(lwpid_t target, int signo); }
656319	STD MPSAFE	{ int sys__lwp_detach(lwpid_t target); }
657320	STD MPSAFE	{ int sys__lwp_park(const struct timespec *ts, \
658				lwpid_t unpark, const void *hint, \
659				const void *unparkhint); }
660321	STD MPSAFE	{ int sys__lwp_unpark(lwpid_t target, const void *hint); }
661322	STD MPSAFE	{ ssize_t sys__lwp_unpark_all(const lwpid_t *targets, \
662				size_t ntargets, const void *hint); }
663; Syscalls 323-339 reserved for LWP syscalls.
664323	UNIMPL
665324	UNIMPL
666325	UNIMPL
667326	UNIMPL
668327	UNIMPL
669328	UNIMPL
670329	UNIMPL
671; Obsolete SA system calls.  Must remain until libc's major version is bumped.
672330	STD MPSAFE	{ int sys_sa_register(void); }
673331	STD MPSAFE	{ int sys_sa_stacks(void); }
674332	STD MPSAFE	{ int sys_sa_enable(void); }
675333	STD MPSAFE	{ int sys_sa_setconcurrency(void); }
676334	STD MPSAFE	{ int sys_sa_yield(void); }
677335	STD MPSAFE	{ int sys_sa_preempt(void); }
678336	STD MPSAFE	{ int sys_sa_unblockyield(void); }
679337	UNIMPL
680338	UNIMPL
681339	UNIMPL
682340	STD MPSAFE	{ int sys___sigaction_sigtramp(int signum, \
683			    const struct sigaction *nsa, \
684			    struct sigaction *osa, \
685			    const void *tramp, int vers); }
686341	STD		{ int sys_pmc_get_info(int ctr, int op, void *args); }
687342	STD		{ int sys_pmc_control(int ctr, int op, void *args); }
688343	STD		{ int sys_rasctl(void *addr, size_t len, int op); }
689344	STD		{ int sys_kqueue(void); }
690345	STD		{ int sys_kevent(int fd, \
691			    const struct kevent *changelist, size_t nchanges, \
692			    struct kevent *eventlist, size_t nevents, \
693			    const struct timespec *timeout); }
694;
695; Syscalls 346-353 are reserved for the IEEE Std1003.1b scheduling syscalls
696;
697346	UNIMPL		sys_sched_setparam
698347	UNIMPL		sys_sched_getparam
699348	UNIMPL		sys_sched_setscheduler
700349	UNIMPL		sys_sched_getscheduler
701350	STD MPSAFE	{ int sys_sched_yield(void); }
702351	UNIMPL		sys_sched_get_priority_max
703352	UNIMPL		sys_sched_get_priority_min
704353	UNIMPL		sys_sched_rr_get_interval
705
706354	STD		{ int sys_fsync_range(int fd, int flags, off_t start, \
707			    off_t length); }
708355	STD		{ int sys_uuidgen(struct uuid *store, int count); }
709356	STD		{ int sys_getvfsstat(struct statvfs *buf, \
710			    size_t bufsize, int flags); }
711357	STD		{ int sys_statvfs1(const char *path, \
712			    struct statvfs *buf, int flags); }
713358	STD		{ int sys_fstatvfs1(int fd, struct statvfs *buf, \
714			    int flags); }
715359	COMPAT_30	{ int sys_fhstatvfs1(const struct compat_30_fhandle *fhp, \
716			    struct statvfs *buf, int flags); }
717360	STD		{ int sys_extattrctl(const char *path, int cmd, \
718			    const char *filename, int attrnamespace, \
719			    const char *attrname); }
720361	STD		{ int sys_extattr_set_file(const char *path, \
721			    int attrnamespace, const char *attrname, \
722			    const void *data, size_t nbytes); }
723362	STD		{ ssize_t sys_extattr_get_file(const char *path, \
724			    int attrnamespace, const char *attrname, \
725			    void *data, size_t nbytes); }
726363	STD		{ int sys_extattr_delete_file(const char *path, \
727			    int attrnamespace, const char *attrname); }
728364	STD		{ int sys_extattr_set_fd(int fd, \
729			    int attrnamespace, const char *attrname, \
730			    const void *data, size_t nbytes); }
731365	STD		{ ssize_t sys_extattr_get_fd(int fd, \
732			    int attrnamespace, const char *attrname, \
733			    void *data, size_t nbytes); }
734366	STD		{ int sys_extattr_delete_fd(int fd, \
735			    int attrnamespace, const char *attrname); }
736367	STD		{ int sys_extattr_set_link(const char *path, \
737			    int attrnamespace, const char *attrname, \
738			    const void *data, size_t nbytes); }
739368	STD		{ ssize_t sys_extattr_get_link(const char *path, \
740			    int attrnamespace, const char *attrname, \
741			    void *data, size_t nbytes); }
742369	STD		{ int sys_extattr_delete_link(const char *path, \
743			    int attrnamespace, const char *attrname); }
744370	STD		{ ssize_t sys_extattr_list_fd(int fd, \
745			    int attrnamespace, void *data, size_t nbytes); }
746371	STD		{ ssize_t sys_extattr_list_file(const char *path, \
747			    int attrnamespace, void *data, size_t nbytes); }
748372	STD		{ ssize_t sys_extattr_list_link(const char *path, \
749			    int attrnamespace, void *data, size_t nbytes); }
750373	STD		{ int sys_pselect(int nd, fd_set *in, fd_set *ou, \
751			    fd_set *ex, const struct timespec *ts, \
752			    const sigset_t *mask); }
753374	STD		{ int sys_pollts(struct pollfd *fds, u_int nfds, \
754			    const struct timespec *ts, const sigset_t *mask); }
755375	STD		{ int sys_setxattr(const char *path, \
756			    const char *name, void *value, size_t size, \
757			    int flags); }
758376	STD		{ int sys_lsetxattr(const char *path, \
759			    const char *name, void *value, size_t size, \
760			    int flags); }
761377	STD		{ int sys_fsetxattr(int fd, \
762			    const char *name, void *value, size_t size, \
763			    int flags); }
764378	STD		{ int sys_getxattr(const char *path, \
765			    const char *name, void *value, size_t size); }
766379	STD		{ int sys_lgetxattr(const char *path, \
767			    const char *name, void *value, size_t size); }
768380	STD		{ int sys_fgetxattr(int fd, \
769			    const char *name, void *value, size_t size); }
770381	STD		{ int sys_listxattr(const char *path, \
771			    char *list, size_t size); }
772382	STD		{ int sys_llistxattr(const char *path, \
773			    char *list, size_t size); }
774383	STD		{ int sys_flistxattr(int fd, \
775			    char *list, size_t size); }
776384	STD		{ int sys_removexattr(const char *path, \
777			    const char *name); }
778385	STD		{ int sys_lremovexattr(const char *path, \
779			    const char *name); }
780386	STD		{ int sys_fremovexattr(int fd, \
781			    const char *name); }
782387	STD		{ int sys___stat30(const char *path, struct stat *ub); }
783388	STD		{ int sys___fstat30(int fd, struct stat *sb); }
784389	STD		{ int sys___lstat30(const char *path, struct stat *ub); }
785390	STD		{ int sys___getdents30(int fd, char *buf, size_t count); }
786391	STD		{ int sys_posix_fadvise(int fd, off_t offset, \
787			    off_t len, int advice); }
788392	COMPAT_30	{ int sys___fhstat30(const struct compat_30_fhandle \
789			    *fhp, struct stat *sb); }
790393	STD		{ int sys___ntp_gettime30(struct ntptimeval *ntvp); }
791394	STD		{ int sys___socket30(int domain, int type, int protocol); }
792395	STD		{ int sys___getfh30(const char *fname, void *fhp, \
793			    size_t *fh_size); }
794396	STD		{ int sys___fhopen40(const void *fhp, size_t fh_size,\
795			    int flags); }
796397	STD		{ int sys___fhstatvfs140(const void *fhp, \
797			    size_t fh_size, struct statvfs *buf, int flags); }
798398	STD		{ int sys___fhstat40(const void *fhp, \
799			    size_t fh_size, struct stat *sb); }
800
801; Asynchronous I/O system calls
802399	STD		{ int sys_aio_cancel(int fildes, struct aiocb *aiocbp); }
803400	STD MPSAFE	{ int sys_aio_error(const struct aiocb *aiocbp); }
804401	STD		{ int sys_aio_fsync(int op, struct aiocb *aiocbp); }
805402	STD		{ int sys_aio_read(struct aiocb *aiocbp); }
806403	STD MPSAFE	{ int sys_aio_return(struct aiocb *aiocbp); }
807404	STD		{ int sys_aio_suspend(const struct aiocb *const *list, \
808			    int nent, const struct timespec *timeout); }
809405	STD		{ int sys_aio_write(struct aiocb *aiocbp); }
810406	STD		{ int sys_lio_listio(int mode, struct aiocb *const *list, \
811			    int nent, struct sigevent *sig); }
812
813407	UNIMPL
814408	UNIMPL
815409	UNIMPL
816
817410	STD		{ int sys___mount50(const char *type, \
818			    const char *path, int flags, void *data, \
819			    size_t data_len); }
820411	STD		{ void *sys_mremap(void *old_address, size_t old_size, \
821			    void *new_address, size_t new_size, int flags); }
822