Module Name:    src
Committed By:   pooka
Date:           Tue Apr  9 13:08:33 UTC 2013

Added Files:
        src/sys/rump/kern/lib/libsys_sunos: Makefile component.c
            rump_sunos_compat.c shlib_version syscalls.conf syscalls.master

Log Message:
Add enough syscall compat for fs-utils to work on modern Solaris
and derivatives.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/rump/kern/lib/libsys_sunos/Makefile \
    src/sys/rump/kern/lib/libsys_sunos/component.c \
    src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c \
    src/sys/rump/kern/lib/libsys_sunos/shlib_version \
    src/sys/rump/kern/lib/libsys_sunos/syscalls.conf \
    src/sys/rump/kern/lib/libsys_sunos/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/rump/kern/lib/libsys_sunos/Makefile
diff -u /dev/null src/sys/rump/kern/lib/libsys_sunos/Makefile:1.1
--- /dev/null	Tue Apr  9 13:08:33 2013
+++ src/sys/rump/kern/lib/libsys_sunos/Makefile	Tue Apr  9 13:08:33 2013
@@ -0,0 +1,12 @@
+#	$NetBSD: Makefile,v 1.1 2013/04/09 13:08:33 pooka Exp $
+#
+
+LIB=	rumpkern_sys_sunos
+
+SRCS=	rump_sunos_compat.c rump_sunos_sysent.c component.c
+
+# XXX
+CPPFLAGS+= -I${.CURDIR} -I${RUMPTOP}/librump/rumpkern
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
Index: src/sys/rump/kern/lib/libsys_sunos/component.c
diff -u /dev/null src/sys/rump/kern/lib/libsys_sunos/component.c:1.1
--- /dev/null	Tue Apr  9 13:08:33 2013
+++ src/sys/rump/kern/lib/libsys_sunos/component.c	Tue Apr  9 13:08:33 2013
@@ -0,0 +1,31 @@
+/*	$NetBSD: component.c,v 1.1 2013/04/09 13:08:33 pooka Exp $	*/
+
+#include <sys/param.h>
+#include <sys/proc.h>
+
+#include <uvm/uvm_extern.h>
+
+#include "rump_private.h"
+
+#include "rump_sunos_syscall.h"
+
+extern struct sysent rump_sunos_sysent[];
+
+struct emul emul_rump_sys_sunos = {
+	.e_name = "sunos-rump",
+	.e_sysent = rump_sunos_sysent,
+#ifndef __HAVE_MINIMAL_EMUL
+	.e_nsysent = RUMP_SUNOS_SYS_NSYSENT,
+#endif
+	.e_vm_default_addr = uvm_default_mapaddr,
+#ifdef __HAVE_SYSCALL_INTERN
+	.e_syscall_intern = syscall_intern,
+#endif
+};
+
+RUMP_COMPONENT(RUMP_COMPONENT_KERN)
+{
+	extern struct emul *emul_default;
+
+	emul_default = &emul_rump_sys_sunos;
+}
Index: src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c
diff -u /dev/null src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c:1.1
--- /dev/null	Tue Apr  9 13:08:33 2013
+++ src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c	Tue Apr  9 13:08:33 2013
@@ -0,0 +1,377 @@
+/*	$NetBSD: rump_sunos_compat.c,v 1.1 2013/04/09 13:08:33 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/dirent.h>
+#include <sys/fcntl.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <sys/malloc.h>
+#include <sys/namei.h>
+#include <sys/stat.h>
+#include <sys/syscallargs.h>
+#include <sys/vnode.h>
+#include <sys/vfs_syscalls.h>
+
+#include <compat/sys/time_types.h>
+
+#include "rump_sunos_syscallargs.h"
+
+#define SUNOS_MAXNAMLEN 255
+
+struct sunos_dirent {
+	uint64_t	d_fileno;
+	int64_t		d_off;
+	unsigned short	d_reclen;
+	char		d_name[SUNOS_MAXNAMLEN + 1];
+};
+
+#define SUNOS_NAMEOFF(dp)	((char *)&(dp)->d_name - (char *)dp)
+#define SUNOS_RECLEN(de,namlen)	ALIGN((SUNOS_NAMEOFF(de) + (namlen) + 1))
+
+/*
+ * Rump kernels always use the _FILE_OFFSET_BITS=64 API.
+ */
+#ifdef __LP64__
+struct sunos_stat {
+        unsigned long	st_dev;
+        uint64_t	st_ino;
+        unsigned int	st_mode;
+        unsigned int	st_nlink;
+        unsigned int	st_uid;
+        unsigned int	st_gid;
+        unsigned long	st_rdev;
+        off_t		st_size;
+
+        struct timespec	st_atim;
+        struct timespec	st_mtim;
+        struct timespec	st_ctim;
+        int		st_blksize;
+        uint64_t	st_blocks;
+        char		st_fstype[16];
+};
+#else
+struct sunos_stat {
+        unsigned long	st_dev;
+	long		st_pad1[3];
+        uint64_t	st_ino;
+        unsigned int	st_mode;
+        unsigned int	st_nlink;
+        unsigned int	st_uid;
+        unsigned int	st_gid;
+        unsigned long	st_rdev;
+	long		st_pad2[2];
+        off_t		st_size;
+
+        struct timespec50 st_atim;
+        struct timespec50 st_mtim;
+        struct timespec50 st_ctim;
+
+        int		st_blksize;
+        uint64_t	st_blocks;
+        char            st_fstype[16];
+	long		st_pad4[8];
+};
+#endif
+
+#define PARCOPY(a) ssb->a = sb->a
+static void
+bsd_to_sunos_stat(const struct stat *sb, struct sunos_stat *ssb)
+{
+
+	memset(ssb, 0, sizeof(*ssb));
+	PARCOPY(st_dev);
+	PARCOPY(st_ino);
+	PARCOPY(st_mode);
+	PARCOPY(st_nlink);
+	PARCOPY(st_uid);
+	PARCOPY(st_gid);
+	PARCOPY(st_rdev);
+	PARCOPY(st_size);
+	PARCOPY(st_blksize);
+	PARCOPY(st_blocks);
+
+#ifdef __LP64__
+	ssb->st_atim = sb->st_atimespec;
+	ssb->st_mtim = sb->st_mtimespec;
+	ssb->st_ctim = sb->st_ctimespec;
+#else
+	timespec_to_timespec50(&sb->st_atimespec, &ssb->st_atim);
+	timespec_to_timespec50(&sb->st_mtimespec, &ssb->st_mtim);
+	timespec_to_timespec50(&sb->st_ctimespec, &ssb->st_ctim);
+#endif
+}
+
+int
+rump_sunos_sys_stat(struct lwp *l, const struct rump_sunos_sys_stat_args *uap,
+	register_t *retval)
+{
+	struct sunos_stat ssb;
+	struct stat sb;
+	int error;
+
+	error = do_sys_stat(SCARG(uap, path), FOLLOW, &sb);
+	if (error)
+		return error;
+
+	bsd_to_sunos_stat(&sb, &ssb);
+
+	return copyout(&ssb, SCARG(uap, sp), sizeof(ssb));
+}
+
+int
+rump_sunos_sys_fstat(struct lwp *l, const struct rump_sunos_sys_fstat_args *uap,
+	register_t *retval)
+{
+	struct sunos_stat ssb;
+	struct stat sb;
+	int error;
+
+	error = do_sys_fstat(SCARG(uap, fd), &sb);
+	if (error)
+		return error;
+
+	bsd_to_sunos_stat(&sb, &ssb);
+
+	return copyout(&ssb, SCARG(uap, sp), sizeof(ssb));
+}
+
+int
+rump_sunos_sys_lstat(struct lwp *l, const struct rump_sunos_sys_lstat_args *uap,
+	register_t *retval)
+{
+	struct sunos_stat ssb;
+	struct stat sb;
+	int error;
+
+	error = do_sys_stat(SCARG(uap, path), NOFOLLOW, &sb);
+	if (error)
+		return error;
+
+	bsd_to_sunos_stat(&sb, &ssb);
+
+	return copyout(&ssb, SCARG(uap, sp), sizeof(ssb));
+}
+
+int
+rump_sunos_sys_open(struct lwp *l, const struct rump_sunos_sys_open_args *uap,
+	register_t *retval)
+{
+	/* {
+		syscallarg(const char *) path;
+		syscallarg(int) flags;
+		syscallarg(int) mode;
+	} */
+	struct sys_open_args ua;
+	int sflags, flags;
+
+	sflags = SCARG(uap, flags);
+	flags =  (sflags & (0x8 | 0x4 | 0x3)); /* nonblock/append/rw */
+	flags |= (sflags & 0x10)	? O_SYNC : 0;
+	flags |= (sflags & 0x40)	? O_DSYNC : 0;
+	flags |= (sflags & 0x8000)	? O_RSYNC : 0;
+	flags |= (sflags & 0x80)	? O_NONBLOCK : 0;
+	flags |= (sflags & 0x100)	? O_CREAT : 0;
+	flags |= (sflags & 0x200)	? O_TRUNC : 0;
+	flags |= (sflags & 0x400)	? O_EXCL : 0;
+	flags |= (sflags & 0x20000)	? O_NOFOLLOW : 0;
+	
+	SCARG(&ua, path) = SCARG(uap, path);
+	SCARG(&ua, flags) = flags;
+	SCARG(&ua, mode) = SCARG(uap, mode);
+
+	return sys_open(l, &ua, retval);
+}
+
+/*-
+ * Copyright (c) 1992, 1993
+ *      The Regents of the University of California.  All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ *      This product includes software developed by the University of
+ *      California, Lawrence Berkeley Laboratory.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *      @(#)sunos_misc.c        8.1 (Berkeley) 6/18/93
+ *
+ *      Header: sunos_misc.c,v 1.16 93/04/07 02:46:27 torek Exp
+ */
+
+int
+rump_sunos_sys_getdents(struct lwp *l,
+	const struct rump_sunos_sys_getdents_args *uap, register_t *retval)
+{
+	struct dirent *bdp;
+	struct vnode *vp;
+	char *inp, *buf;	/* BSD-format */
+	int len, reclen;	/* BSD-format */
+	char *outp;		/* Sun-format */
+	int resid, sunos_reclen;/* Sun-format */
+	struct file *fp;
+	struct uio auio;
+	struct iovec aiov;
+	struct sunos_dirent idb;
+	off_t off;			/* true file offset */
+	int buflen, error, eofflag;
+	off_t *cookiebuf, *cookie;
+	int ncookies;
+
+	if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
+		return (error);
+
+	if ((fp->f_flag & FREAD) == 0) {
+		error = EBADF;
+		goto out1;
+	}
+
+	vp = fp->f_data;
+	if (vp->v_type != VDIR) {
+		error = EINVAL;
+		goto out1;
+	}
+
+	buflen = min(MAXBSIZE, SCARG(uap, nbytes));
+	buf = malloc(buflen, M_TEMP, M_WAITOK);
+	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+	off = fp->f_offset;
+again:
+	aiov.iov_base = buf;
+	aiov.iov_len = buflen;
+	auio.uio_iov = &aiov;
+	auio.uio_iovcnt = 1;
+	auio.uio_rw = UIO_READ;
+	auio.uio_resid = buflen;
+	auio.uio_offset = off;
+	UIO_SETUP_SYSSPACE(&auio);
+	/*
+	 * First we read into the malloc'ed buffer, then
+	 * we massage it into user space, one record at a time.
+	 */
+	error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &cookiebuf,
+	    &ncookies);
+	if (error)
+		goto out;
+
+	inp = buf;
+	outp = SCARG(uap, buf);
+	resid = SCARG(uap, nbytes);
+	if ((len = buflen - auio.uio_resid) == 0)
+		goto eof;
+
+	for (cookie = cookiebuf; len > 0; len -= reclen) {
+		bdp = (struct dirent *)inp;
+		reclen = bdp->d_reclen;
+		if (reclen & 3)
+			panic("sunos_getdents");
+		if ((*cookie >> 32) != 0) {
+			printf("rump_sunos_sys_getdents: offset too large\n");
+			error = EINVAL;
+			goto out;
+		}
+		if (bdp->d_fileno == 0) {
+			inp += reclen;	/* it is a hole; squish it out */
+			if (cookie)
+				off = *cookie++;
+			else
+				off += reclen;
+			continue;
+		}
+		sunos_reclen = SUNOS_RECLEN(&idb, bdp->d_namlen);
+		if (reclen > len || resid < sunos_reclen) {
+			/* entry too big for buffer, so just stop */
+			outp++;
+			break;
+		}
+		if (cookie)
+			off = *cookie++;	/* each entry points to next */
+		else
+			off += reclen;
+		/*
+		 * Massage in place to make a Sun-shaped dirent (otherwise
+		 * we have to worry about touching user memory outside of
+		 * the copyout() call).
+		 */
+		idb.d_fileno = bdp->d_fileno;
+		idb.d_off = off;
+		idb.d_reclen = sunos_reclen;
+		strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name));
+		if ((error = copyout((void *)&idb, outp, sunos_reclen)) != 0)
+			goto out;
+		/* advance past this real entry */
+		inp += reclen;
+		/* advance output past Sun-shaped entry */
+		outp += sunos_reclen;
+		resid -= sunos_reclen;
+	}
+
+	/* if we squished out the whole block, try again */
+	if (outp == SCARG(uap, buf)) {
+		if (cookiebuf)
+			free(cookiebuf, M_TEMP);
+		cookiebuf = NULL;
+		goto again;
+	}
+	fp->f_offset = off;		/* update the vnode offset */
+
+eof:
+	*retval = SCARG(uap, nbytes) - resid;
+out:
+	VOP_UNLOCK(vp);
+	free(cookiebuf, M_TEMP);
+	free(buf, M_TEMP);
+ out1:
+ 	fd_putfile(SCARG(uap, fd));
+	return (error);
+}
Index: src/sys/rump/kern/lib/libsys_sunos/shlib_version
diff -u /dev/null src/sys/rump/kern/lib/libsys_sunos/shlib_version:1.1
--- /dev/null	Tue Apr  9 13:08:33 2013
+++ src/sys/rump/kern/lib/libsys_sunos/shlib_version	Tue Apr  9 13:08:33 2013
@@ -0,0 +1,4 @@
+#	$NetBSD: shlib_version,v 1.1 2013/04/09 13:08:33 pooka Exp $
+#
+major=0
+minor=0
Index: src/sys/rump/kern/lib/libsys_sunos/syscalls.conf
diff -u /dev/null src/sys/rump/kern/lib/libsys_sunos/syscalls.conf:1.1
--- /dev/null	Tue Apr  9 13:08:33 2013
+++ src/sys/rump/kern/lib/libsys_sunos/syscalls.conf	Tue Apr  9 13:08:33 2013
@@ -0,0 +1,14 @@
+#	$NetBSD: syscalls.conf,v 1.1 2013/04/09 13:08:33 pooka Exp $
+#
+
+sysnames="rump_sunos_syscalls.c"
+sysnumhdr="rump_sunos_syscall.h"
+syssw="rump_sunos_sysent.c"
+sysarghdr="rump_sunos_syscallargs.h"
+compatopts=""
+libcompatopts=""
+
+switchname="rump_sunos_sysent"
+namesname="rump_sunos_syscallnames"
+constprefix="RUMP_SUNOS_SYS_"
+nsysent=512
Index: src/sys/rump/kern/lib/libsys_sunos/syscalls.master
diff -u /dev/null src/sys/rump/kern/lib/libsys_sunos/syscalls.master:1.1
--- /dev/null	Tue Apr  9 13:08:33 2013
+++ src/sys/rump/kern/lib/libsys_sunos/syscalls.master	Tue Apr  9 13:08:33 2013
@@ -0,0 +1,576 @@
+	$NetBSD: syscalls.master,v 1.1 2013/04/09 13:08:33 pooka Exp $
+
+;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
+
+; NetBSD system call name/number "master" file.
+; (See syscalls.conf to see what it is processed into.)
+;
+; Fields: number type [type-dependent ...]
+;	number	system call number, must be in order
+;	type	one of NODEF, UNIMPL, or NOARGS
+;
+; types:
+;	NODEF	always included
+;	UNIMPL	unimplemented, not included in system
+;	NODEF	included, but don't define the syscall number
+;	NOARGS	included, but don't define the syscall args structure
+;
+; arguments:
+;	PAD	argument not part of the C interface, used only for padding
+;
+;
+; Support just enough syscalls to make fs-utils run (plus a few other
+; low-hanging fruit)
+;
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/signal.h>
+#include <sys/socket.h>
+#include <sys/mount.h>
+#include <sys/sched.h>
+#include <sys/syscallargs.h>
+
+#include <compat/sunos/sunos.h>
+
+#include "rump_sunos_syscallargs.h"
+
+%%
+
+0	NOARGS		{ int|sys||nosys(void); }
+1	UNIMPL 		exit
+2	UNIMPL 		fork
+3	NOARGS		{ ssize_t|sys||read(int fd, void *buf, size_t nbyte); }
+4	NOARGS		{ ssize_t|sys||write(int fd, const void *buf, \
+			    size_t nbyte); }
+5	NODEF		{ int|rump_sunos_sys||open(const char *path, \
+			    int flags, int mode); }
+6	NOARGS	 	{ int|sys||close(int fd); }
+7	UNIMPL		wait4
+8	UNIMPL		creat
+9	NOARGS 		{ int|sys||link(const char *path, const char *link); }
+10	NOARGS 	 	{ int|sys||unlink(const char *path); }
+11	UNIMPL		execv
+12	NOARGS 	 	{ int|sys||chdir(const char *path); }
+13	NOARGS 	 	{ int|sys||fchdir(int fd); }
+14	UNIMPL		mknod
+15	NOARGS 	 	{ int|sys||chmod(const char *path, int mode); }
+16	NOARGS 	 	{ int|sys||chown(const char *path, int uid, int gid); }
+17	UNIMPL		obreak
+18	UNIMPL		getfsstat
+19	UNIMPL		lseek
+20	NOARGS 		{ pid_t|sys||getpid_with_ppid(void); } getpid
+21	UNIMPL		mount
+22	UNIMPL		unmount
+23	NOARGS		{ int|sys||setuid(int uid); }
+24	NOARGS		{ int|sys||getuid_with_euid(void); } getuid
+25	NOARGS		{ int|sys||geteuid(void); }
+26	UNIMPL 		ptrace
+27	UNIMPL		recvmsg
+28	UNIMPL		sendmsg
+29	UNIMPL		recvfrom
+30	UNIMPL		accept
+31	UNIMPL		getpeername
+32	UNIMPL		getsockname
+33	NOARGS 		{ int|sys||access(const char *path, int flags); }
+34	UNIMPL		chflags
+35	UNIMPL		fchflags
+36	NOARGS		{ void|sys||sync(void); }
+37	UNIMPL 		kill
+38	UNIMPL		stat
+39	UNIMPL		getppid
+40	UNIMPL		lstat
+41	NOARGS 		{ int|sys||dup(int fd); }
+42	NOARGS 		{ int|sys||pipe(void); }
+43	UNIMPL		getegid
+44	UNIMPL 		profil
+45	UNIMPL 		ktrace
+46	UNIMPL		sigaction
+47	NOARGS 		{ int|sys||getgid_with_egid(void); } getgid
+48	UNIMPL		sigprocmask
+49	UNIMPL		__getlogin
+50	UNIMPL		__setlogin
+51	UNIMPL		acct
+52	UNIMPL  	sigpending
+53	UNIMPL  	sigaltstack
+54	UNIMPL		ioctl
+55	UNIMPL		reboot
+56	UNIMPL		revoke
+57	NOARGS 	 	{ int|sys||symlink(const char *path, \
+			    const char *link); }
+58	NOARGS 	 	{ ssize_t|sys||readlink(const char *path, char *buf, \
+			    int count); }
+59	UNIMPL 		execve
+60	NOARGS 	 	{ mode_t|sys||umask(mode_t newmask); }
+61	NOARGS 	 	{ int|sys||chroot(const char *path); }
+62	UNIMPL		fstat43
+63	UNIMPL		getkerninfo
+64	UNIMPL		getpagesize
+65	UNIMPL		msync
+66	UNIMPL 		vfork
+67	UNIMPL		vread
+68	UNIMPL		vwrite
+69	UNIMPL 		sbrk
+70	UNIMPL 		sstk
+71	UNIMPL  	mmap
+72	UNIMPL 		ovadvise
+73	UNIMPL 		munmap
+74	UNIMPL 		mprotect
+75	UNIMPL 		madvise
+76	UNIMPL		vhangup
+77	UNIMPL		vlimit
+78	UNIMPL 		mincore
+79	NOARGS 		{ int|sys||getgroups(int gidsetsize, \
+			    int *gidset); }
+80	NOARGS 		{ int|sys||setgroups(int gidsetsize, \
+			    const int *gidset); }
+81	NOARGS 		{ int|sys||getpgrp(void); }
+82	NOARGS 		{ int|sys||setpgid(int pid, int pgid); }
+83	UNIMPL		setitimer
+84	UNIMPL		wait
+85	UNIMPL		swapon
+86	UNIMPL		getitimer
+87	UNIMPL		gethostname
+88	UNIMPL		sethostname
+89	UNIMPL		getdtablesize
+90	NOARGS 	 	{ int|sys||dup2(int from, int to); }
+91	UNIMPL		getdopt
+92	UNIMPL		fcntl
+93	UNIMPL		select
+94	UNIMPL		setdopt
+95	NOARGS		{ int|sys||fsync(int fd); }
+96	UNIMPL		setpriority
+97	UNIMPL		socket
+98	UNIMPL		connect
+99	UNIMPL		accept
+100	UNIMPL 		getpriority
+
+101	UNIMPL		send
+102	UNIMPL		recv
+
+103	UNIMPL		sigreturn
+104	UNIMPL		bind
+105	UNIMPL		setsockopt
+106	UNIMPL		listen
+107	UNIMPL		vtimes
+108	UNIMPL		sigvec
+109	UNIMPL		sigblock
+110	UNIMPL		sigsetmask
+111	UNIMPL		sigsuspend
+112	UNIMPL		sigstack
+113	UNIMPL		orecvmsg
+114	UNIMPL		osendmsg
+115	UNIMPL		vtrace
+116	UNIMPL		gettimeofday
+117	UNIMPL 		getrusage
+118	UNIMPL		getsockopt
+119	UNIMPL		resuba
+120	NOARGS 		{ ssize_t|sys||readv(int fd, \
+			    struct iovec *iovp, int iovcnt); }
+121	NOARGS 		{ ssize_t|sys||writev(int fd, \
+			    struct iovec *iovp, int iovcnt); }
+122	UNIMPL		settimeofday
+123	NOARGS 	 	{ int|sys||fchown(int fd, int uid, int gid); }
+124	NOARGS 	 	{ int|sys||fchmod(int fd, int mode); }
+125	UNIMPL		orecvfrom
+126	NOARGS 		{ int|sys||setreuid(int ruid, int euid); }
+127	NOARGS 		{ int|sys||setregid(int rgid, int egid); }
+128	NOARGS 	 	{ int|sys||rename(char *from, char *to); }
+129	UNIMPL		otruncate
+130	UNIMPL		oftruncate
+131	NOARGS 	 	{ int|sys||flock(int fd, int how); }
+132	UNIMPL 	 	mkfifo
+133	NOARGS 	 	{ int|sys||sendto(int s, void *buf, \
+			    int len, int flags, void *to, int tolen); }
+134	NOARGS	 	{ int|sys||shutdown(int s, int how); }
+135	UNIMPL	 	socketpair
+136	NOARGS 	 	{ int|sys||mkdir(const char *path, int mode); }
+137	NOARGS 	 	{ int|sys||rmdir(const char *path); }
+138	UNIMPL		utimes
+
+139	UNIMPL		4.2 sigreturn
+140	UNIMPL		adjtime
+141	UNIMPL		ogetpeername
+142	UNIMPL		ogethostid
+143	UNIMPL		osethostid
+144	UNIMPL		ogetrlimit
+145	UNIMPL		osetrlimit
+146	UNIMPL		okillpg
+147	NOARGS 		{ int|sys||setsid(void); }
+148	UNIMPL		quotactl
+149	UNIMPL		oquota
+150	UNIMPL		ogetsockname
+
+; Syscalls 151-180 inclusive are reserved for vendor-specific
+; system calls.  (This includes various calls added for compatibity
+; with other Unix variants.)
+; Some of these calls are now supported by BSD...
+151	UNIMPL
+152	UNIMPL
+153	UNIMPL
+154	UNIMPL
+155	UNIMPL		nfssvc
+156	UNIMPL		ogetdirentries
+157	UNIMPL		statfs12
+158	UNIMPL		fstatfs12
+159	UNIMPL
+160	UNIMPL
+161	UNIMPL		getfh30
+162	UNIMPL		ogetdomainname
+163	UNIMPL		osetdomainname
+164	UNIMPL		ouname
+165	UNIMPL 		sysarch
+166	UNIMPL
+167	UNIMPL
+168	UNIMPL
+169	UNIMPL		1.0 semsys
+170	UNIMPL		1.0 msgsys
+171	UNIMPL		1.0 shmsys
+172	UNIMPL
+173	NOARGS 	 	{ ssize_t|sys||pread(int fd, char *buf, \
+			    size_t nbyte, int PAD, off_t offset); }
+174	NOARGS 	 	{ ssize_t|sys||pwrite(int fd, char *buf, \
+			    size_t nbyte, int PAD, off_t offset); }
+175	UNIMPL		ntp_gettime
+176	UNIMPL		ntp_adjtime
+177	UNIMPL
+178	UNIMPL
+179	UNIMPL
+180	UNIMPL
+
+; Syscalls 180-199 are used by/reserved for BSD
+181	NOARGS 		{ int|sys||setgid(gid_t gid); }
+182	NOARGS 		{ int|sys||setegid(gid_t egid); }
+183	NOARGS 		{ int|sys||seteuid(uid_t euid); }
+184	UNIMPL		lfs_bmapv
+185	UNIMPL		lfs_markv
+186	UNIMPL		lfs_segclean
+187	UNIMPL		lfs_segwait
+188	UNIMPL		stat12
+189	UNIMPL		fstat12
+190	UNIMPL		lstat12
+191	UNIMPL 		pathconf
+192	UNIMPL 		fpathconf
+193	UNIMPL
+194	UNIMPL 		getrlimit
+195	UNIMPL 		setrlimit
+196	UNIMPL		getdirentries
+197	UNIMPL		mmap
+198	UNIMPL		__syscall
+199	NOARGS 	 	{ long|sys||lseek(int fd, int PAD, off_t offset, \
+			    int whence); }
+200	NOARGS 	 	{ int|sys||truncate(const char *path, int PAD, \
+			    off_t length); }
+201	NOARGS 	 	{ int|sys||ftruncate(int fd, int PAD, off_t length); }
+202	UNIMPL		__sysctl
+203	UNIMPL		mlock
+204	UNIMPL		munlock
+205	UNIMPL		undelete
+206	UNIMPL		futimes
+207	NOARGS 	 	{ pid_t|sys||getpgid(pid_t pid); }
+208	UNIMPL	 	reboot
+209	NOARGS 	 	{ int|sys||poll(struct pollfd *fds, u_int nfds, \
+			    int timeout); }
+;
+; Syscalls 210-219 are reserved for dynamically loaded syscalls
+;
+210	UNIMPL	 	afssys
+211	UNIMPL
+212	UNIMPL
+213	UNIMPL
+214	UNIMPL
+215	UNIMPL
+216	UNIMPL
+217	UNIMPL
+218	UNIMPL
+219	UNIMPL
+220	UNIMPL		compat_14_semctl
+221	UNIMPL		semget
+222	UNIMPL		semop
+223	UNIMPL		semconfig
+224	UNIMPL 		compat_14_msgctl
+225	UNIMPL 		msgget
+226	UNIMPL 		msgsnd
+227	UNIMPL 		msgrcv
+228	UNIMPL		shmat
+229	UNIMPL		compat_14_shmctl
+230	UNIMPL		shmdt
+231	UNIMPL		shmget
+
+232	UNIMPL		clock_gettime
+233	UNIMPL		clock_settime
+234	UNIMPL		clock_getres
+235	UNIMPL		timer_create
+236	UNIMPL		timer_delete
+237	UNIMPL		timer_settime
+238	UNIMPL		timer_gettime
+239	UNIMPL		timer_getoverrun
+;
+; Syscalls 240-269 are reserved for other IEEE Std1003.1b syscalls
+;
+240	UNIMPL		nanosleep
+241	UNIMPL 	 	fdatasync
+242	UNIMPL		mlockall
+243	UNIMPL		munlockall
+244	UNIMPL		__sigtimedwait
+245	UNIMPL		sigqueueinfo
+246	UNIMPL		modctl
+247	UNIMPL		_ksem_init
+248	UNIMPL		_ksem_open
+249	UNIMPL		_ksem_unlink
+250	UNIMPL		_ksem_close
+251	UNIMPL		_ksem_post
+252	UNIMPL		_ksem_wait
+253	UNIMPL		_ksem_trywait
+254	UNIMPL		_ksem_getvalue
+255	UNIMPL		_ksem_destroy
+256	UNIMPL		_ksem_timedwait
+
+257	UNIMPL		mq_open
+258	UNIMPL		mq_close
+259	UNIMPL		mq_unlink
+260	UNIMPL		mq_getattr
+261	UNIMPL		mq_setattr
+262	UNIMPL		mq_notify
+263	UNIMPL		mq_send
+264	UNIMPL		mq_receive
+265	UNIMPL		mq_timedsend
+266	UNIMPL		mq_timedreceive
+267	UNIMPL
+268	UNIMPL
+269	UNIMPL
+270	UNIMPL		__posix_rename
+271	UNIMPL		swapctl
+272	UNIMPL		getdents
+273	UNIMPL		minherit
+274	UNIMPL 	 	lchmod
+275	UNIMPL 	 	lchown
+276	UNIMPL		lutimes
+277	UNIMPL		msync
+278	UNIMPL		stat
+279	UNIMPL		fstat
+280	UNIMPL		lstat
+281	UNIMPL		sigaltstack
+282	UNIMPL		vfork
+283	UNIMPL		__posix_chown
+284	UNIMPL		__posix_fchown
+285	UNIMPL		__posix_lchown
+286	NOARGS 		{ pid_t|sys||getsid(pid_t pid); }
+
+287	UNIMPL		__clone
+288	UNIMPL		fktrace
+289	UNIMPL 		{ ssize_t|sys||preadv(int fd, \
+			    const struct iovec *iovp, int iovcnt, \
+			    int PAD, off_t offset); }
+290	UNIMPL 		{ ssize_t|sys||pwritev(int fd, \
+			    const struct iovec *iovp, int iovcnt, \
+			    int PAD, off_t offset); }
+291	UNIMPL		sigaction
+292	UNIMPL		sigpending
+293	UNIMPL		sigprocmask
+294	UNIMPL		sigsuspend
+295	UNIMPL		sigreturn
+296	NOARGS 	 	{ int|sys||__getcwd(char *bufp, size_t length); }
+297	NOARGS 	 	{ int|sys||fchroot(int fd); }
+298	UNIMPL		fhopen
+299	UNIMPL		fhstat
+300	UNIMPL		fhstatfs
+301	UNIMPL		____semctl13
+302	UNIMPL		__msgctl13
+303	UNIMPL		__shmctl13
+304	UNIMPL 	 	lchflags
+305	UNIMPL		issetugid
+306	UNIMPL		utrace
+307	UNIMPL		getcontext
+308	UNIMPL		setcontext
+309	UNIMPL		_lwp_create
+310	UNIMPL		_lwp_exit
+311	UNIMPL		_lwp_self
+312	UNIMPL		_lwp_wait
+313	UNIMPL		_lwp_suspend
+314	UNIMPL		_lwp_continue
+315	UNIMPL		_lwp_wakeup
+316	UNIMPL		_lwp_getprivate
+317	UNIMPL		_lwp_setprivate
+318	UNIMPL		_lwp_kill
+319	UNIMPL		_lwp_detach
+320	UNIMPL		_lwp_park
+321	UNIMPL		_lwp_unpark
+322	UNIMPL		_lwp_unpark_all
+323	UNIMPL		_lwp_setname
+324	UNIMPL		_lwp_getname
+325	UNIMPL		_lwp_ctl
+
+; Syscalls 326-339 reserved for LWP syscalls.
+326	UNIMPL
+327	UNIMPL
+328	UNIMPL
+329	UNIMPL
+; SA system calls.
+330	UNIMPL		sa_register
+331	UNIMPL		sa_stacks
+332	UNIMPL		sa_enable
+333	UNIMPL		sa_setconcurrency
+334	UNIMPL		sa_yield
+335	UNIMPL		sa_preempt
+336	UNIMPL 		sys_sa_unblockyield
+;
+; Syscalls 337-339 are reserved for other scheduler activation syscalls.
+;
+337	UNIMPL
+338	UNIMPL
+339	UNIMPL
+
+340	UNIMPL		__sigaction_sigtramp
+341	UNIMPL		pmc_get_info
+342	UNIMPL		pmc_control
+343	UNIMPL		rasctl
+344	UNIMPL		kqueue
+345	UNIMPL		kevent
+
+; Scheduling system calls.
+346	UNIMPL		_sched_setparam
+347	UNIMPL		_sched_getparam
+348	UNIMPL		_sched_setaffinity
+349	UNIMPL		_sched_getaffinity
+350	UNIMPL		sched_yield
+351	UNIMPL
+352	UNIMPL
+353	UNIMPL
+
+354	UNIMPL		fsync_range
+355	UNIMPL		uuidgen
+356	UNIMPL		getvfsstat
+357	UNIMPL		statvfs1
+358	UNIMPL		fstatvfs1
+359	UNIMPL		fhstatvfs1
+360	UNIMPL		extattrctl
+361	UNIMPL		extattr_set_file
+362	UNIMPL		extattr_get_file
+363	UNIMPL		extattr_delete_file
+364	UNIMPL		extattr_set_fd
+365	UNIMPL		extattr_get_fd
+366	UNIMPL		extattr_delete_fd
+367	UNIMPL		extattr_set_link
+368	UNIMPL		extattr_get_link
+369	UNIMPL		extattr_delete_link
+370	UNIMPL		extattr_list_fd
+371	UNIMPL		extattr_list_file
+372	UNIMPL		extattr_list_link
+373	UNIMPL		pselect
+374	UNIMPL		pollts
+375	UNIMPL		setxattr
+376	UNIMPL		lsetxattr
+377	UNIMPL		fsetxattr
+378	UNIMPL		getxattr
+379	UNIMPL		lgetxattr
+380	UNIMPL		fgetxattr
+381	UNIMPL		listxattr
+382	UNIMPL		llistxattr
+383	UNIMPL		flistxattr
+384	UNIMPL		removexattr
+385	UNIMPL		lremovexattr
+386	UNIMPL		fremovexattr
+387	UNIMPL		stat30
+388	UNIMPL		fstat30
+389	UNIMPL		lstat30
+390	NODEF		{ int|rump_sunos_sys||getdents(int fd, \
+			    char *buf, size_t nbytes); }
+391	UNIMPL		old posix_fadvise
+392	UNIMPL		fhstat
+393	UNIMPL		ntp_gettime
+394	UNIMPL		socket
+395	UNIMPL		getfh
+396	UNIMPL		fhopen
+397	UNIMPL		fhstatvfs1
+398	UNIMPL		fhstat
+
+; Asynchronous I/O system calls
+399	UNIMPL		aio_cancel
+400	UNIMPL		aio_error
+401	UNIMPL		aio_fsync
+402	UNIMPL		aio_read
+403	UNIMPL		aio_return
+404	UNIMPL		aio_suspend
+405	UNIMPL		aio_write
+406	UNIMPL		lio_listio
+
+407	UNIMPL
+408	UNIMPL
+409	UNIMPL
+
+410	UNIMPL		mount
+411	UNIMPL		mremap
+
+; Processor-sets system calls
+412	UNIMPL		pset_create
+413	UNIMPL		pset_destroy
+414	UNIMPL		pset_assign
+415	UNIMPL		_pset_bind
+416	UNIMPL		fadvise
+417	UNIMPL		select
+418	UNIMPL		gettimeofday
+419	UNIMPL		settimeofday
+420	UNIMPL		utimes
+421	UNIMPL		adjtime
+422	UNIMPL		lfs_segwait
+423	UNIMPL		futimes
+424	UNIMPL		lutimes
+425	UNIMPL		setitimer
+426	UNIMPL		getitimer
+427	UNIMPL		clock_gettime
+428	UNIMPL		clock_settime
+429	UNIMPL		clock_getres
+430	UNIMPL		nanosleep
+431	UNIMPL		__sigtimedwait
+432	UNIMPL		mq_timedsend
+433	UNIMPL		mq_timedreceive
+434	UNIMPL		_lwp_park
+435	UNIMPL		kevent
+436	UNIMPL		pselect
+437	UNIMPL		ppoll
+438	UNIMPL		aio_suspend
+439	NODEF 		{ int|rump_sunos_sys||stat(const char *path, \
+			    struct sunos_stat *sp); }
+440	NODEF 		{ int|rump_sunos_sys||fstat(int fd, \
+			    struct sunos_stat *sp); }
+441	NODEF 		{ int|rump_sunos_sys||lstat(const char *path, \
+			    struct sunos_stat *sp); }
+442	UNIMPL		__semctl
+443	UNIMPL		shmctl
+444	UNIMPL		msgctl
+445	UNIMPL		getrusage
+446	UNIMPL		timer_settime
+447	UNIMPL		timer_gettime
+448	UNIMPL		ntp_gettime
+449	UNIMPL		wait4
+450	NOARGS 		{ int|sys|50|mknod(const char *path, mode_t mode, \
+			    int dev); }
+451	UNIMPL		fhstat
+
+; 452 only ever appeared in 5.99.x and can be reused after netbsd-7
+452	UNIMPL		5.99 quotactl
+453	UNIMPL		pipe2
+454	UNIMPL		dup3
+455	UNIMPL		kqueue1
+456	UNIMPL		paccept
+457	UNIMPL		linkat
+458	UNIMPL		renameat
+459	UNIMPL		mkfifoat
+460	UNIMPL		mknodat
+461	UNIMPL		mkdirat
+462	UNIMPL		faccessat
+463	UNIMPL		fchmodat
+464	UNIMPL		fchownat
+465	UNIMPL		fexecve
+466	UNIMPL		fstatat
+467	UNIMPL		utimensat
+468	UNIMPL		openat
+469	UNIMPL		readlinkat
+470	UNIMPL		symlinkat
+471	UNIMPL		unlinkat
+472	UNIMPL		futimens
+473	UNIMPL		__quotactl
+474	UNIMPL		posix_spawn
+475	UNIMPL		recvmmsg
+476	UNIMPL		sendmmsg

Reply via email to