syscalls.master revision 1.176
1	$NetBSD: syscalls.master,v 1.176 2007/08/15 12:08:38 ad 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	UNIMPL		sys_mq_open
545258	UNIMPL		sys_mq_close
546259	UNIMPL		sys_mq_unlink
547260	UNIMPL		sys_mq_getattr
548261	UNIMPL		sys_mq_setattr
549262	UNIMPL		sys_mq_notify
550263	UNIMPL		sys_mq_send
551264	UNIMPL		sys_mq_receive
552265	UNIMPL		sys_mq_timedsend
553266	UNIMPL		sys_mq_timedreceive
554267	UNIMPL
555268	UNIMPL
556269	UNIMPL
557270	STD		{ int sys___posix_rename(const char *from, \
558			    const char *to); }
559271	STD		{ int sys_swapctl(int cmd, void *arg, int misc); }
560272	COMPAT_30	{ int sys_getdents(int fd, char *buf, size_t count); }
561273	STD		{ int sys_minherit(void *addr, size_t len, \
562			    int inherit); }
563274	STD		{ int sys_lchmod(const char *path, mode_t mode); }
564275	STD		{ int sys_lchown(const char *path, uid_t uid, \
565			    gid_t gid); }
566276	STD		{ int sys_lutimes(const char *path, \
567			    const struct timeval *tptr); }
568277	STD		{ int sys___msync13(void *addr, size_t len, int flags); }
569278	COMPAT_30	{ int sys___stat13(const char *path, struct stat13 *ub); }
570279	COMPAT_30	{ int sys___fstat13(int fd, struct stat13 *sb); }
571280	COMPAT_30	{ int sys___lstat13(const char *path, struct stat13 *ub); }
572281	STD MPSAFE	{ int sys___sigaltstack14( \
573			    const struct sigaltstack *nss, \
574			    struct sigaltstack *oss); }
575282	STD		{ int sys___vfork14(void); }
576283	STD		{ int sys___posix_chown(const char *path, uid_t uid, \
577			    gid_t gid); }
578284	STD		{ int sys___posix_fchown(int fd, uid_t uid, \
579			    gid_t gid); }
580285	STD		{ int sys___posix_lchown(const char *path, uid_t uid, \
581			    gid_t gid); }
582286	STD MPSAFE	{ pid_t sys_getsid(pid_t pid); }
583287	STD		{ pid_t sys___clone(int flags, void *stack); }
584288	STD		{ int sys_fktrace(const int fd, int ops, \
585			    int facs, int pid); }
586289	STD		{ ssize_t sys_preadv(int fd, \
587			    const struct iovec *iovp, int iovcnt, \
588			    int pad, off_t offset); }
589290	STD		{ ssize_t sys_pwritev(int fd, \
590			    const struct iovec *iovp, int iovcnt, \
591			    int pad, off_t offset); }
592291	COMPAT_16 MPSAFE	{ int sys___sigaction14(int signum, \
593			    const struct sigaction *nsa, \
594			    struct sigaction *osa); }
595292	STD MPSAFE	{ int sys___sigpending14(sigset_t *set); }
596293	STD MPSAFE	{ int sys___sigprocmask14(int how, \
597			    const sigset_t *set, \
598			    sigset_t *oset); }
599294	STD MPSAFE	{ int sys___sigsuspend14(const sigset_t *set); }
600295	COMPAT_16 MPSAFE { int sys___sigreturn14(struct sigcontext *sigcntxp); }
601296	STD		{ int sys___getcwd(char *bufp, size_t length); }
602297	STD		{ int sys_fchroot(int fd); }
603298	COMPAT_30	{ int sys_fhopen(const struct compat_30_fhandle *fhp, int flags); }
604299	COMPAT_30	{ int sys_fhstat(const struct compat_30_fhandle *fhp, \
605			    struct stat13 *sb); }
606300	COMPAT_20	{ int sys_fhstatfs(const struct compat_30_fhandle *fhp, \
607			    struct statfs12 *buf); }
608#if defined(SYSVSEM) || !defined(_KERNEL)
609301	STD MPSAFE	{ int sys_____semctl13(int semid, int semnum, int cmd, \
610			    ... union __semun *arg); }
611#else
612301	EXCL		____semctl13
613#endif
614#if defined(SYSVMSG) || !defined(_KERNEL)
615302	STD MPSAFE	{ int sys___msgctl13(int msqid, int cmd, \
616			    struct msqid_ds *buf); }
617#else
618302	EXCL		__msgctl13
619#endif
620#if defined(SYSVSHM) || !defined(_KERNEL)
621303	STD 		{ int sys___shmctl13(int shmid, int cmd, \
622			    struct shmid_ds *buf); }
623#else
624303	EXCL		__shmctl13
625#endif
626304	STD		{ int sys_lchflags(const char *path, u_long flags); }
627305	STD MPSAFE	{ int sys_issetugid(void); }
628306	STD MPSAFE	{ int sys_utrace(const char *label, void *addr, \
629				size_t len); }
630307	STD MPSAFE	{ int sys_getcontext(struct __ucontext *ucp); }
631308	STD MPSAFE	{ int sys_setcontext(const struct __ucontext *ucp); }
632309	STD		{ int sys__lwp_create(const struct __ucontext *ucp, \
633				u_long flags, lwpid_t *new_lwp); }
634310	STD		{ int sys__lwp_exit(void); }
635311	STD MPSAFE	{ lwpid_t sys__lwp_self(void); }
636312	STD MPSAFE	{ int sys__lwp_wait(lwpid_t wait_for, \
637				lwpid_t *departed); }
638313	STD MPSAFE	{ int sys__lwp_suspend(lwpid_t target); }
639314	STD MPSAFE	{ int sys__lwp_continue(lwpid_t target); }
640315	STD MPSAFE	{ int sys__lwp_wakeup(lwpid_t target); }
641316	STD MPSAFE	{ void *sys__lwp_getprivate(void); }
642317	STD MPSAFE	{ void sys__lwp_setprivate(void *ptr); }
643318	STD		{ int sys__lwp_kill(lwpid_t target, int signo); }
644319	STD MPSAFE	{ int sys__lwp_detach(lwpid_t target); }
645320	STD MPSAFE	{ int sys__lwp_park(const struct timespec *ts, \
646				lwpid_t unpark, const void *hint, \
647				const void *unparkhint); }
648321	STD MPSAFE	{ int sys__lwp_unpark(lwpid_t target, const void *hint); }
649322	STD MPSAFE	{ ssize_t sys__lwp_unpark_all(const lwpid_t *targets, \
650				size_t ntargets, const void *hint); }
651; Syscalls 323-339 reserved for LWP syscalls.
652323	UNIMPL
653324	UNIMPL
654325	UNIMPL
655326	UNIMPL
656327	UNIMPL
657328	UNIMPL
658329	UNIMPL
659; Obsolete SA system calls.  Must remain until libc's major version is bumped.
660330	STD MPSAFE	{ int sys_sa_register(void); }
661331	STD MPSAFE	{ int sys_sa_stacks(void); }
662332	STD MPSAFE	{ int sys_sa_enable(void); }
663333	STD MPSAFE	{ int sys_sa_setconcurrency(void); }
664334	STD MPSAFE	{ int sys_sa_yield(void); }
665335	STD MPSAFE	{ int sys_sa_preempt(void); }
666336	STD MPSAFE	{ int sys_sa_unblockyield(void); }
667337	UNIMPL
668338	UNIMPL
669339	UNIMPL
670340	STD MPSAFE	{ int sys___sigaction_sigtramp(int signum, \
671			    const struct sigaction *nsa, \
672			    struct sigaction *osa, \
673			    const void *tramp, int vers); }
674341	STD		{ int sys_pmc_get_info(int ctr, int op, void *args); }
675342	STD		{ int sys_pmc_control(int ctr, int op, void *args); }
676343	STD		{ int sys_rasctl(void *addr, size_t len, int op); }
677344	STD		{ int sys_kqueue(void); }
678345	STD		{ int sys_kevent(int fd, \
679			    const struct kevent *changelist, size_t nchanges, \
680			    struct kevent *eventlist, size_t nevents, \
681			    const struct timespec *timeout); }
682;
683; Syscalls 346-353 are reserved for the IEEE Std1003.1b scheduling syscalls
684;
685346	UNIMPL		sys_sched_setparam
686347	UNIMPL		sys_sched_getparam
687348	UNIMPL		sys_sched_setscheduler
688349	UNIMPL		sys_sched_getscheduler
689350	STD MPSAFE	{ int sys_sched_yield(void); }
690351	UNIMPL		sys_sched_get_priority_max
691352	UNIMPL		sys_sched_get_priority_min
692353	UNIMPL		sys_sched_rr_get_interval
693
694354	STD		{ int sys_fsync_range(int fd, int flags, off_t start, \
695			    off_t length); }
696355	STD		{ int sys_uuidgen(struct uuid *store, int count); }
697356	STD		{ int sys_getvfsstat(struct statvfs *buf, \
698			    size_t bufsize, int flags); }
699357	STD		{ int sys_statvfs1(const char *path, \
700			    struct statvfs *buf, int flags); }
701358	STD		{ int sys_fstatvfs1(int fd, struct statvfs *buf, \
702			    int flags); }
703359	COMPAT_30	{ int sys_fhstatvfs1(const struct compat_30_fhandle *fhp, \
704			    struct statvfs *buf, int flags); }
705360	STD		{ int sys_extattrctl(const char *path, int cmd, \
706			    const char *filename, int attrnamespace, \
707			    const char *attrname); }
708361	STD		{ int sys_extattr_set_file(const char *path, \
709			    int attrnamespace, const char *attrname, \
710			    const void *data, size_t nbytes); }
711362	STD		{ ssize_t sys_extattr_get_file(const char *path, \
712			    int attrnamespace, const char *attrname, \
713			    void *data, size_t nbytes); }
714363	STD		{ int sys_extattr_delete_file(const char *path, \
715			    int attrnamespace, const char *attrname); }
716364	STD		{ int sys_extattr_set_fd(int fd, \
717			    int attrnamespace, const char *attrname, \
718			    const void *data, size_t nbytes); }
719365	STD		{ ssize_t sys_extattr_get_fd(int fd, \
720			    int attrnamespace, const char *attrname, \
721			    void *data, size_t nbytes); }
722366	STD		{ int sys_extattr_delete_fd(int fd, \
723			    int attrnamespace, const char *attrname); }
724367	STD		{ int sys_extattr_set_link(const char *path, \
725			    int attrnamespace, const char *attrname, \
726			    const void *data, size_t nbytes); }
727368	STD		{ ssize_t sys_extattr_get_link(const char *path, \
728			    int attrnamespace, const char *attrname, \
729			    void *data, size_t nbytes); }
730369	STD		{ int sys_extattr_delete_link(const char *path, \
731			    int attrnamespace, const char *attrname); }
732370	STD		{ ssize_t sys_extattr_list_fd(int fd, \
733			    int attrnamespace, void *data, size_t nbytes); }
734371	STD		{ ssize_t sys_extattr_list_file(const char *path, \
735			    int attrnamespace, void *data, size_t nbytes); }
736372	STD		{ ssize_t sys_extattr_list_link(const char *path, \
737			    int attrnamespace, void *data, size_t nbytes); }
738373	STD		{ int sys_pselect(int nd, fd_set *in, fd_set *ou, \
739			    fd_set *ex, const struct timespec *ts, \
740			    const sigset_t *mask); }
741374	STD		{ int sys_pollts(struct pollfd *fds, u_int nfds, \
742			    const struct timespec *ts, const sigset_t *mask); }
743375	STD		{ int sys_setxattr(const char *path, \
744			    const char *name, void *value, size_t size, \
745			    int flags); }
746376	STD		{ int sys_lsetxattr(const char *path, \
747			    const char *name, void *value, size_t size, \
748			    int flags); }
749377	STD		{ int sys_fsetxattr(int fd, \
750			    const char *name, void *value, size_t size, \
751			    int flags); }
752378	STD		{ int sys_getxattr(const char *path, \
753			    const char *name, void *value, size_t size); }
754379	STD		{ int sys_lgetxattr(const char *path, \
755			    const char *name, void *value, size_t size); }
756380	STD		{ int sys_fgetxattr(int fd, \
757			    const char *name, void *value, size_t size); }
758381	STD		{ int sys_listxattr(const char *path, \
759			    char *list, size_t size); }
760382	STD		{ int sys_llistxattr(const char *path, \
761			    char *list, size_t size); }
762383	STD		{ int sys_flistxattr(int fd, \
763			    char *list, size_t size); }
764384	STD		{ int sys_removexattr(const char *path, \
765			    const char *name); }
766385	STD		{ int sys_lremovexattr(const char *path, \
767			    const char *name); }
768386	STD		{ int sys_fremovexattr(int fd, \
769			    const char *name); }
770387	STD		{ int sys___stat30(const char *path, struct stat *ub); }
771388	STD		{ int sys___fstat30(int fd, struct stat *sb); }
772389	STD		{ int sys___lstat30(const char *path, struct stat *ub); }
773390	STD		{ int sys___getdents30(int fd, char *buf, size_t count); }
774391	STD		{ int sys_posix_fadvise(int fd, off_t offset, \
775			    off_t len, int advice); }
776392	COMPAT_30	{ int sys___fhstat30(const struct compat_30_fhandle \
777			    *fhp, struct stat *sb); }
778393	STD		{ int sys___ntp_gettime30(struct ntptimeval *ntvp); }
779394	STD		{ int sys___socket30(int domain, int type, int protocol); }
780395	STD		{ int sys___getfh30(const char *fname, void *fhp, \
781			    size_t *fh_size); }
782396	STD		{ int sys___fhopen40(const void *fhp, size_t fh_size,\
783			    int flags); }
784397	STD		{ int sys___fhstatvfs140(const void *fhp, \
785			    size_t fh_size, struct statvfs *buf, int flags); }
786398	STD		{ int sys___fhstat40(const void *fhp, \
787			    size_t fh_size, struct stat *sb); }
788
789; Asynchronous I/O system calls
790399	STD		{ int sys_aio_cancel(int fildes, struct aiocb *aiocbp); }
791400	STD MPSAFE	{ int sys_aio_error(const struct aiocb *aiocbp); }
792401	STD		{ int sys_aio_fsync(int op, struct aiocb *aiocbp); }
793402	STD		{ int sys_aio_read(struct aiocb *aiocbp); }
794403	STD MPSAFE	{ int sys_aio_return(struct aiocb *aiocbp); }
795404	STD		{ int sys_aio_suspend(const struct aiocb *const *list, \
796			    int nent, const struct timespec *timeout); }
797405	STD		{ int sys_aio_write(struct aiocb *aiocbp); }
798406	STD		{ int sys_lio_listio(int mode, struct aiocb *const *list, \
799			    int nent, struct sigevent *sig); }
800
801407	UNIMPL
802408	UNIMPL
803409	UNIMPL
804
805410	STD		{ int sys___mount50(const char *type, \
806			    const char *path, int flags, void *data, \
807			    size_t data_len); }
808411	STD		{ void *sys_mremap(void *old_address, size_t old_size, \
809			    void *new_address, size_t new_size, int flags); }
810