diff options
Diffstat (limited to 'sys/compat')
41 files changed, 0 insertions, 8151 deletions
diff --git a/sys/compat/ibcs2/Makefile b/sys/compat/ibcs2/Makefile deleted file mode 100644 index 08804819216..00000000000 --- a/sys/compat/ibcs2/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $OpenBSD: Makefile,v 1.3 2001/08/26 03:23:44 deraadt Exp $ -# $NetBSD: Makefile,v 1.1 1996/09/03 03:18:12 mycroft Exp $ - -DEP= syscalls.conf syscalls.master ../../kern/makesyscalls.sh -OBJS= ibcs2_sysent.c ibcs2_syscalls.c ibcs2_syscall.h ibcs2_syscallargs.h - -${OBJS}: ${DEP} - sh ../../kern/makesyscalls.sh syscalls.conf syscalls.master diff --git a/sys/compat/ibcs2/TODO b/sys/compat/ibcs2/TODO deleted file mode 100644 index 1c3f9bc9768..00000000000 --- a/sys/compat/ibcs2/TODO +++ /dev/null @@ -1,8 +0,0 @@ -$OpenBSD: TODO,v 1.2 1996/08/02 20:35:01 niklas Exp $ -$NetBSD: TODO,v 1.3 1995/03/14 15:12:17 scottb Exp $ - -* handle directory reads for filenames > 14 char - -* finish implementing ioctl()'s: - - IBCS2_TCSBRK, IBCS2_TCXONC, IBCS2_TCFLSH diff --git a/sys/compat/ibcs2/files.ibcs2 b/sys/compat/ibcs2/files.ibcs2 deleted file mode 100644 index c107894e3fe..00000000000 --- a/sys/compat/ibcs2/files.ibcs2 +++ /dev/null @@ -1,20 +0,0 @@ -# $OpenBSD: files.ibcs2,v 1.6 1999/11/10 15:55:21 mickey Exp $ -# $NetBSD: files.ibcs2,v 1.3 1995/08/14 01:34:09 mycroft Exp $ -# -# Config file description for machine-independent IBCS-2 compat code. -# Included by ports that need it. - -# ports should define any machine-specific files they need in their -# own file lists. - -file compat/ibcs2/ibcs2_errno.c compat_ibcs2 -file compat/ibcs2/ibcs2_exec.c compat_ibcs2 -file compat/ibcs2/ibcs2_fcntl.c compat_ibcs2 -file compat/ibcs2/ibcs2_ioctl.c compat_ibcs2 -file compat/ibcs2/ibcs2_ipc.c compat_ibcs2 -file compat/ibcs2/ibcs2_misc.c compat_ibcs2 -file compat/ibcs2/ibcs2_signal.c compat_ibcs2 -file compat/ibcs2/ibcs2_socksys.c compat_ibcs2 -file compat/ibcs2/ibcs2_stat.c compat_ibcs2 -file compat/ibcs2/ibcs2_syscalls.c compat_ibcs2 & syscall_debug -file compat/ibcs2/ibcs2_sysent.c compat_ibcs2 diff --git a/sys/compat/ibcs2/ibcs2_dirent.h b/sys/compat/ibcs2/ibcs2_dirent.h deleted file mode 100644 index 29a0dcff1d0..00000000000 --- a/sys/compat/ibcs2/ibcs2_dirent.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $OpenBSD: ibcs2_dirent.h,v 1.2 1996/08/02 20:35:02 niklas Exp $ */ -/* $NetBSD: ibcs2_dirent.h,v 1.3 1995/10/09 11:23:57 mycroft Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - - -#ifndef _IBCS2_DIRENT_H -#define _IBCS2_DIRENT_H 1 - -#include <compat/ibcs2/ibcs2_types.h> - -#define IBCS2_MAXNAMLEN 512 - -struct ibcs2_dirent { - ibcs2_ino_t d_ino; - short d_pad; - ibcs2_off_t d_off; - u_short d_reclen; - char d_name[IBCS2_MAXNAMLEN + 1]; -}; - -#define IBCS2_NAMEOFF(dp) ((char *)&(dp)->d_name - (char *)dp) -#define IBCS2_RECLEN(de,namlen) ALIGN((IBCS2_NAMEOFF(de) + (namlen) + 1)) - -#endif /* _IBCS2_DIRENT_H */ diff --git a/sys/compat/ibcs2/ibcs2_errno.c b/sys/compat/ibcs2/ibcs2_errno.c deleted file mode 100644 index 4b2e137ced9..00000000000 --- a/sys/compat/ibcs2/ibcs2_errno.c +++ /dev/null @@ -1,131 +0,0 @@ -/* $OpenBSD: ibcs2_errno.c,v 1.6 2009/10/28 16:38:43 jsg Exp $ */ -/* $NetBSD: ibcs2_errno.c,v 1.2 1996/05/03 17:05:16 christos Exp $ */ - -/* - * ibcs2_errno.c - * Copyright (c) 1995 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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/errno.h> -#include <compat/ibcs2/ibcs2_errno.h> - -int bsd2ibcs_errno[1 + ELAST] = { - 0, /* 0 */ - IBCS2_EPERM, /* 1 */ - IBCS2_ENOENT, /* 2 */ - IBCS2_ESRCH, /* 3 */ - IBCS2_EINTR, /* 4 */ - IBCS2_EIO, /* 5 */ - IBCS2_ENXIO, /* 6 */ - IBCS2_E2BIG, /* 7 */ - IBCS2_ENOEXEC, /* 8 */ - IBCS2_EBADF, /* 9 */ - IBCS2_ECHILD, /* 10 */ - IBCS2_EDEADLK, /* 11 */ - IBCS2_ENOMEM, /* 12 */ - IBCS2_EACCES, /* 13 */ - IBCS2_EFAULT, /* 14 */ - IBCS2_ENOTBLK, /* 15 */ - IBCS2_EBUSY, /* 16 */ - IBCS2_EEXIST, /* 17 */ - IBCS2_EXDEV, /* 18 */ - IBCS2_ENODEV, /* 19 */ - IBCS2_ENOTDIR, /* 20 */ - IBCS2_EISDIR, /* 21 */ - IBCS2_EINVAL, /* 22 */ - IBCS2_ENFILE, /* 23 */ - IBCS2_EMFILE, /* 24 */ - IBCS2_ENOTTY, /* 25 */ - IBCS2_ETXTBSY, /* 26 */ - IBCS2_EFBIG, /* 27 */ - IBCS2_ENOSPC, /* 28 */ - IBCS2_ESPIPE, /* 29 */ - IBCS2_EROFS, /* 30 */ - IBCS2_EMLINK, /* 31 */ - IBCS2_EPIPE, /* 32 */ - IBCS2_EDOM, /* 33 */ - IBCS2_ERANGE, /* 34 */ - IBCS2_EAGAIN, /* 35 */ - IBCS2_EINPROGRESS, /* 36 */ - IBCS2_EALREADY, /* 37 */ - IBCS2_ENOTSOCK, /* 38 */ - IBCS2_EDESTADDRREQ, /* 39 */ - IBCS2_EMSGSIZE, /* 40 */ - IBCS2_EPROTOTYPE, /* 41 */ - IBCS2_ENOPROTOOPT, /* 42 */ - IBCS2_EPROTONOSUPPORT, /* 43 */ - IBCS2_ESOCKTNOSUPPORT, /* 44 */ - IBCS2_EOPNOTSUPP, /* 45 */ - IBCS2_EPFNOSUPPORT, /* 46 */ - IBCS2_EAFNOSUPPORT, /* 47 */ - IBCS2_EADDRINUSE, /* 48 */ - IBCS2_EADDRNOTAVAIL, /* 49 */ - IBCS2_ENETDOWN, /* 50 */ - IBCS2_ENETUNREACH, /* 51 */ - IBCS2_ENETRESET, /* 52 */ - IBCS2_ECONNABORTED, /* 53 */ - IBCS2_ECONNRESET, /* 54 */ - IBCS2_ENOBUFS, /* 55 */ - IBCS2_EISCONN, /* 56 */ - IBCS2_ENOTCONN, /* 57 */ - IBCS2_ESHUTDOWN, /* 58 */ - IBCS2_ETOOMANYREFS, /* 59 */ - IBCS2_ETIMEDOUT, /* 60 */ - IBCS2_ECONNREFUSED, /* 61 */ - IBCS2_ELOOP, /* 62 */ - IBCS2_ENAMETOOLONG, /* 63 */ - IBCS2_EHOSTDOWN, /* 64 */ - IBCS2_EHOSTUNREACH, /* 65 */ - IBCS2_ENOTEMPTY, /* 66 */ - IBCS2_ENOSYS, /* 67 unavailable? */ - IBCS2_ENOSYS, /* 68 unavailable? */ - IBCS2_ENOSYS, /* 69 unavailable? */ - IBCS2_ESTALE, /* 70 */ - IBCS2_EREMOTE, /* 71 */ - IBCS2_ENOSYS, /* 72 unavailable? */ - IBCS2_ENOSYS, /* 73 unavailable? */ - IBCS2_ENOSYS, /* 74 unavailable? */ - IBCS2_ENOSYS, /* 75 unavailable? */ - IBCS2_ENOSYS, /* 76 unavailable? */ - IBCS2_ENOLCK, /* 77 */ - IBCS2_ENOSYS, /* 78 */ - IBCS2_ENOSYS, /* 79 unavailable? */ - IBCS2_ENOSYS, /* 80 unavailable? */ - IBCS2_ENOSYS, /* 81 unavailable? */ - IBCS2_ENOSYS, /* 82 unavailable? */ - IBCS2_ENOSYS, /* 83 unavailable? */ - IBCS2_ENOSYS, /* 84 unavailable? */ - IBCS2_ENOSYS, /* 85 unavailable? */ - IBCS2_ENOSYS, /* 86 unavailable? */ - IBCS2_ENOSYS, /* 87 unavailable? */ - IBCS2_ENOSYS, /* 88 unavailable? */ - IBCS2_EIDRM, /* 89 */ - IBCS2_ENOMSG, /* 90 */ - IBCS2_ENOSYS /* 91 unavailable? */ -}; diff --git a/sys/compat/ibcs2/ibcs2_errno.h b/sys/compat/ibcs2/ibcs2_errno.h deleted file mode 100644 index 42b5d0fa539..00000000000 --- a/sys/compat/ibcs2/ibcs2_errno.h +++ /dev/null @@ -1,156 +0,0 @@ -/* $OpenBSD: ibcs2_errno.h,v 1.3 1996/08/02 20:35:03 niklas Exp $ */ -/* $NetBSD: ibcs2_errno.h,v 1.2 1996/05/03 17:05:18 christos Exp $ */ - -/* - * ibcs2_errno.h - * Copyright (c) 1995 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_ERRNO_H -#define _IBCS2_ERRNO_H - -#define _SCO_NET 1 - -#define IBCS2_EPERM 1 -#define IBCS2_ENOENT 2 -#define IBCS2_ESRCH 3 -#define IBCS2_EINTR 4 -#define IBCS2_EIO 5 -#define IBCS2_ENXIO 6 -#define IBCS2_E2BIG 7 -#define IBCS2_ENOEXEC 8 -#define IBCS2_EBADF 9 -#define IBCS2_ECHILD 10 -#define IBCS2_EAGAIN 11 -#define IBCS2_ENOMEM 12 -#define IBCS2_EACCES 13 -#define IBCS2_EFAULT 14 -#define IBCS2_ENOTBLK 15 -#define IBCS2_EBUSY 16 -#define IBCS2_EEXIST 17 -#define IBCS2_EXDEV 18 -#define IBCS2_ENODEV 19 -#define IBCS2_ENOTDIR 20 -#define IBCS2_EISDIR 21 -#define IBCS2_EINVAL 22 -#define IBCS2_ENFILE 23 -#define IBCS2_EMFILE 24 -#define IBCS2_ENOTTY 25 -#define IBCS2_ETXTBSY 26 -#define IBCS2_EFBIG 27 -#define IBCS2_ENOSPC 28 -#define IBCS2_ESPIPE 29 -#define IBCS2_EROFS 30 -#define IBCS2_EMLINK 31 -#define IBCS2_EPIPE 32 -#define IBCS2_EDOM 33 -#define IBCS2_ERANGE 34 -#define IBCS2_ENOMSG 35 -#define IBCS2_EIDRM 36 -#define IBCS2_ECHRNG 37 -#define IBCS2_EL2NSYNC 38 -#define IBCS2_EL3HLT 39 -#define IBCS2_EL3RST 40 -#define IBCS2_ELNRNG 41 -#define IBCS2_EUNATCH 42 -#define IBCS2_ENOCSI 43 -#define IBCS2_EL2HLT 44 -#define IBCS2_EDEADLK 45 -#define IBCS2_ENOLCK 46 -#define IBCS2_ENOSTR 60 -#define IBCS2_ENODATA 61 -#define IBCS2_ETIME 62 -#define IBCS2_ENOSR 63 -#define IBCS2_ENONET 64 -#define IBCS2_ENOPKG 65 -#define IBCS2_EREMOTE 66 -#define IBCS2_ENOLINK 67 -#define IBCS2_EADV 68 -#define IBCS2_ESRMNT 69 -#define IBCS2_ECOMM 70 -#define IBCS2_EPROTO 71 -#define IBCS2_EMULTIHOP 74 -#define IBCS2_ELBIN 75 -#define IBCS2_EDOTDOT 76 -#define IBCS2_EBADMSG 77 -#define IBCS2_ENAMETOOLONG 78 -#define IBCS2_EOVERFLOW 79 -#define IBCS2_ENOTUNIQ 80 -#define IBCS2_EBADFD 81 -#define IBCS2_EREMCHG 82 -#define IBCS2_EILSEQ 88 -#define IBCS2_ENOSYS 89 - -#if defined(_SCO_NET) /* not strict iBCS2 */ -#define IBCS2_EWOULDBLOCK 90 -#define IBCS2_EINPROGRESS 91 -#define IBCS2_EALREADY 92 -#define IBCS2_ENOTSOCK 93 -#define IBCS2_EDESTADDRREQ 94 -#define IBCS2_EMSGSIZE 95 -#define IBCS2_EPROTOTYPE 96 -#define IBCS2_EPROTONOSUPPORT 97 -#define IBCS2_ESOCKTNOSUPPORT 98 -#define IBCS2_EOPNOTSUPP 99 -#define IBCS2_EPFNOSUPPORT 100 -#define IBCS2_EAFNOSUPPORT 101 -#define IBCS2_EADDRINUSE 102 -#define IBCS2_EADDRNOTAVAIL 103 -#define IBCS2_ENETDOWN 104 -#define IBCS2_ENETUNREACH 105 -#define IBCS2_ENETRESET 106 -#define IBCS2_ECONNABORTED 107 -#define IBCS2_ECONNRESET 108 -#define IBCS2_ENOBUFS IBCS2_ENOSR -#define IBCS2_EISCONN 110 -#define IBCS2_ENOTCONN 111 -#define IBCS2_ESHUTDOWN 112 -#define IBCS2_ETOOMANYREFS 113 -#define IBCS2_ETIMEDOUT 114 -#define IBCS2_ECONNREFUSED 115 -#define IBCS2_EHOSTDOWN 116 -#define IBCS2_EHOSTUNREACH 117 -#define IBCS2_ENOPROTOOPT 118 -#define IBCS2_ENOTEMPTY 145 -#define IBCS2_ELOOP 150 -#else -#define IBCS2_ELOOP 90 -#define IBCS2_EWOULDBLOCK 90 -#define IBCS2_ERESTART 91 -#define IBCS2_ESTRPIPE 92 -#define IBCS2_ENOTEMPTY 93 -#define IBCS2_EUSERS 94 -#endif - -#define IBCS2_ESTALE 151 -#define IBCS2_EIORESID 500 - -extern int bsd2ibcs_errno[]; - -#endif /* _IBCS2_ERRNO_H */ diff --git a/sys/compat/ibcs2/ibcs2_exec.c b/sys/compat/ibcs2/ibcs2_exec.c deleted file mode 100644 index fd9c94417b8..00000000000 --- a/sys/compat/ibcs2/ibcs2_exec.c +++ /dev/null @@ -1,751 +0,0 @@ -/* $OpenBSD: ibcs2_exec.c,v 1.20 2009/06/01 20:11:38 weingart Exp $ */ -/* $NetBSD: ibcs2_exec.c,v 1.12 1996/10/12 02:13:52 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Scott Bartram - * Copyright (c) 1994 Adam Glass - * Copyright (c) 1993, 1994 Christopher G. Demetriou - * All rights reserved. - * - * originally from kern/exec_ecoff.c - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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/systm.h> -#include <sys/proc.h> -#include <sys/core.h> -#include <sys/exec.h> -#include <sys/malloc.h> -#include <sys/vnode.h> -#include <sys/resourcevar.h> -#include <sys/namei.h> -#include <uvm/uvm_extern.h> - -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_exec.h> -#include <compat/ibcs2/ibcs2_util.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_syscall.h> - -int exec_ibcs2_coff_prep_omagic(struct proc *, struct exec_package *, - struct coff_filehdr *, - struct coff_aouthdr *); -int exec_ibcs2_coff_prep_nmagic(struct proc *, struct exec_package *, - struct coff_filehdr *, - struct coff_aouthdr *); -int exec_ibcs2_coff_prep_zmagic(struct proc *, struct exec_package *, - struct coff_filehdr *, - struct coff_aouthdr *); -int exec_ibcs2_coff_setup_stack(struct proc *, struct exec_package *); -void cpu_exec_ibcs2_coff_setup(int, struct proc *, struct exec_package *, - void *); - -int exec_ibcs2_xout_prep_nmagic(struct proc *, struct exec_package *, - struct xexec *, struct xext *); -int exec_ibcs2_xout_prep_zmagic(struct proc *, struct exec_package *, - struct xexec *, struct xext *); -int exec_ibcs2_xout_setup_stack(struct proc *, struct exec_package *); -int coff_load_shlib(struct proc *, char *, struct exec_package *); -static int coff_find_section(struct proc *, struct vnode *, - struct coff_filehdr *, struct coff_scnhdr *, - int); - - -extern int bsd2ibcs_errno[]; -extern struct sysent ibcs2_sysent[]; -#ifdef SYSCALL_DEBUG -extern char *ibcs2_syscallnames[]; -#endif -extern char sigcode[], esigcode[]; - -const char ibcs2_emul_path[] = "/emul/ibcs2"; - -struct emul emul_ibcs2 = { - "ibcs2", - bsd2ibcs_errno, - ibcs2_sendsig, - 0, - IBCS2_SYS_MAXSYSCALL, - ibcs2_sysent, -#ifdef SYSCALL_DEBUG - ibcs2_syscallnames, -#else - NULL, -#endif - 0, - copyargs, - setregs, - NULL, - coredump_trad, - sigcode, - esigcode, -}; - -/* - * exec_ibcs2_coff_makecmds(): Check if it's an coff-format executable. - * - * Given a proc pointer and an exec package pointer, see if the referent - * of the epp is in coff format. Check 'standard' magic numbers for - * this architecture. If that fails, return failure. - * - * This function is responsible for creating a set of vmcmds which can be - * used to build the process's vm space and inserting them into the exec - * package. - */ - -int -exec_ibcs2_coff_makecmds(p, epp) - struct proc *p; - struct exec_package *epp; -{ - int error; - struct coff_filehdr *fp = epp->ep_hdr; - struct coff_aouthdr *ap; - - if (epp->ep_hdrvalid < COFF_HDR_SIZE) - return ENOEXEC; - - if (COFF_BADMAG(fp)) - return ENOEXEC; - - ap = (struct coff_aouthdr *)((char *)epp->ep_hdr + - sizeof(struct coff_filehdr)); - switch (ap->a_magic) { - case COFF_OMAGIC: - error = exec_ibcs2_coff_prep_omagic(p, epp, fp, ap); - break; - case COFF_NMAGIC: - error = exec_ibcs2_coff_prep_nmagic(p, epp, fp, ap); - break; - case COFF_ZMAGIC: - error = exec_ibcs2_coff_prep_zmagic(p, epp, fp, ap); - break; - default: - return ENOEXEC; - } - - if (error == 0) - epp->ep_emul = &emul_ibcs2; - - if (error) - kill_vmcmds(&epp->ep_vmcmds); - - return error; -} - -/* - * exec_ibcs2_coff_setup_stack(): Set up the stack segment for a coff - * executable. - * - * Note that the ep_ssize parameter must be set to be the current stack - * limit; this is adjusted in the body of execve() to yield the - * appropriate stack segment usage once the argument length is - * calculated. - * - * This function returns an int for uniformity with other (future) formats' - * stack setup functions. They might have errors to return. - */ - -int -exec_ibcs2_coff_setup_stack(p, epp) - struct proc *p; - struct exec_package *epp; -{ - /* DPRINTF(("enter exec_ibcs2_coff_setup_stack\n")); */ - - epp->ep_maxsaddr = USRSTACK - MAXSSIZ; - epp->ep_minsaddr = USRSTACK; - epp->ep_ssize = p->p_rlimit[RLIMIT_STACK].rlim_cur; - - /* - * set up commands for stack. note that this takes *two*, one to - * map the part of the stack which we can access, and one to map - * the part which we can't. - * - * arguably, it could be made into one, but that would require the - * addition of another mapping proc, which is unnecessary - * - * note that in memory, things assumed to be: 0 ....... ep_maxsaddr - * <stack> ep_minsaddr - */ - /* DPRINTF(("VMCMD: addr %x size %d\n", epp->ep_maxsaddr, - (epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr)); */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, - ((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr), - epp->ep_maxsaddr, NULLVP, 0, VM_PROT_NONE); - /* DPRINTF(("VMCMD: addr %x size %d\n", - epp->ep_minsaddr - epp->ep_ssize, - epp->ep_ssize)); */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, epp->ep_ssize, - (epp->ep_minsaddr - epp->ep_ssize), NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return 0; -} - - -/* - * exec_ibcs2_coff_prep_omagic(): Prepare a COFF OMAGIC binary's exec package - */ - -int -exec_ibcs2_coff_prep_omagic(p, epp, fp, ap) - struct proc *p; - struct exec_package *epp; - struct coff_filehdr *fp; - struct coff_aouthdr *ap; -{ - epp->ep_taddr = COFF_SEGMENT_ALIGN(ap, ap->a_tstart); - epp->ep_tsize = ap->a_tsize; - epp->ep_daddr = COFF_SEGMENT_ALIGN(ap, ap->a_dstart); - epp->ep_dsize = ap->a_dsize; - epp->ep_entry = ap->a_entry; - - /* set up command for text and data segments */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, - ap->a_tsize + ap->a_dsize, epp->ep_taddr, epp->ep_vp, - COFF_TXTOFF(fp, ap), - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* set up command for bss segment */ - if (ap->a_bsize > 0) - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, ap->a_bsize, - COFF_SEGMENT_ALIGN(ap, ap->a_dstart + ap->a_dsize), - NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return exec_ibcs2_coff_setup_stack(p, epp); -} - -/* - * exec_ibcs2_coff_prep_nmagic(): Prepare a 'native' NMAGIC COFF binary's exec - * package. - */ - -int -exec_ibcs2_coff_prep_nmagic(p, epp, fp, ap) - struct proc *p; - struct exec_package *epp; - struct coff_filehdr *fp; - struct coff_aouthdr *ap; -{ - epp->ep_taddr = COFF_SEGMENT_ALIGN(ap, ap->a_tstart); - epp->ep_tsize = ap->a_tsize; - epp->ep_daddr = COFF_ROUND(ap->a_dstart, COFF_LDPGSZ); - epp->ep_dsize = ap->a_dsize; - epp->ep_entry = ap->a_entry; - - /* set up command for text segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, epp->ep_tsize, - epp->ep_taddr, epp->ep_vp, COFF_TXTOFF(fp, ap), - VM_PROT_READ|VM_PROT_EXECUTE); - - /* set up command for data segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, epp->ep_dsize, - epp->ep_daddr, epp->ep_vp, COFF_DATOFF(fp, ap), - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* set up command for bss segment */ - if (ap->a_bsize > 0) - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, ap->a_bsize, - COFF_SEGMENT_ALIGN(ap, ap->a_dstart + ap->a_dsize), - NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return exec_ibcs2_coff_setup_stack(p, epp); -} - -/* - * coff_find_section - load specified section header - * - * TODO - optimize by reading all section headers in at once - */ - -static int -coff_find_section(p, vp, fp, sh, s_type) - struct proc *p; - struct vnode *vp; - struct coff_filehdr *fp; - struct coff_scnhdr *sh; - int s_type; -{ - int i, pos, error; - size_t siz, resid; - - pos = COFF_HDR_SIZE; - for (i = 0; i < fp->f_nscns; i++, pos += sizeof(struct coff_scnhdr)) { - siz = sizeof(struct coff_scnhdr); - error = vn_rdwr(UIO_READ, vp, (caddr_t) sh, - siz, pos, UIO_SYSSPACE, 0, p->p_ucred, - &resid, p); - if (error) { - DPRINTF(("section hdr %d read error %d\n", i, error)); - return error; - } - siz -= resid; - if (siz != sizeof(struct coff_scnhdr)) { - DPRINTF(("incomplete read: hdr %d ask=%d, rem=%u got %u\n", - s_type, sizeof(struct coff_scnhdr), - resid, siz)); - return ENOEXEC; - } - /* DPRINTF(("found section: %x\n", sh->s_flags)); */ - if (sh->s_flags == s_type) - return 0; - } - return ENOEXEC; -} - -/* - * exec_ibcs2_coff_prep_zmagic(): Prepare a COFF ZMAGIC binary's exec package - * - * First, set the various offsets/lengths in the exec package. - * - * Then, mark the text image busy (so it can be demand paged) or error - * out if this is not possible. Finally, set up vmcmds for the - * text, data, bss, and stack segments. - */ - -int -exec_ibcs2_coff_prep_zmagic(p, epp, fp, ap) - struct proc *p; - struct exec_package *epp; - struct coff_filehdr *fp; - struct coff_aouthdr *ap; -{ - int error; - u_long offset; - long dsize, baddr, bsize; - struct coff_scnhdr sh; - - /* DPRINTF(("enter exec_ibcs2_coff_prep_zmagic\n")); */ - - /* set up command for text segment */ - error = coff_find_section(p, epp->ep_vp, fp, &sh, COFF_STYP_TEXT); - if (error) { - DPRINTF(("can't find text section: %d\n", error)); - return error; - } - /* DPRINTF(("COFF text addr %x size %d offset %d\n", sh.s_vaddr, - sh.s_size, sh.s_scnptr)); */ - epp->ep_taddr = COFF_ALIGN(sh.s_vaddr); - offset = sh.s_scnptr - (sh.s_vaddr - epp->ep_taddr); - epp->ep_tsize = sh.s_size + (sh.s_vaddr - epp->ep_taddr); - -#ifdef notyet - /* - * check if vnode is in open for writing, because we want to - * demand-page out of it. if it is, don't do it, for various - * reasons -n */ - if ((ap->a_tsize != 0 || ap->a_dsize != 0) && - epp->ep_vp->v_writecount != 0) { -#ifdef DIAGNOSTIC - if (epp->ep_vp->v_flag & VTEXT) - panic("exec: a VTEXT vnode has writecount != 0"); -#endif - return ETXTBSY; - } - vn_marktext(epp->ep_vp); -#endif - - /* DPRINTF(("VMCMD: addr %x size %d offset %d\n", epp->ep_taddr, - epp->ep_tsize, offset)); */ -#ifdef notyet - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, epp->ep_tsize, - epp->ep_taddr, epp->ep_vp, offset, - VM_PROT_READ|VM_PROT_EXECUTE); -#else - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, epp->ep_tsize, - epp->ep_taddr, epp->ep_vp, offset, - VM_PROT_READ|VM_PROT_EXECUTE); -#endif - - /* set up command for data segment */ - error = coff_find_section(p, epp->ep_vp, fp, &sh, COFF_STYP_DATA); - if (error) { - DPRINTF(("can't find data section: %d\n", error)); - return error; - } - /* DPRINTF(("COFF data addr %x size %d offset %d\n", sh.s_vaddr, - sh.s_size, sh.s_scnptr)); */ - epp->ep_daddr = COFF_ALIGN(sh.s_vaddr); - offset = sh.s_scnptr - (sh.s_vaddr - epp->ep_daddr); - dsize = sh.s_size + (sh.s_vaddr - epp->ep_daddr); - epp->ep_dsize = dsize + ap->a_bsize; - - /* DPRINTF(("VMCMD: addr %x size %d offset %d\n", epp->ep_daddr, - dsize, offset)); */ -#ifdef notyet - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, dsize, - epp->ep_daddr, epp->ep_vp, offset, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); -#else - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, - dsize, epp->ep_daddr, epp->ep_vp, offset, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); -#endif - - /* set up command for bss segment */ - baddr = round_page(epp->ep_daddr + dsize); - bsize = epp->ep_daddr + epp->ep_dsize - baddr; - if (bsize > 0) { - /* DPRINTF(("VMCMD: addr %x size %d offset %d\n", - baddr, bsize, 0)); */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, - bsize, baddr, NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - } - - /* load any shared libraries */ - error = coff_find_section(p, epp->ep_vp, fp, &sh, COFF_STYP_SHLIB); - if (!error) { - size_t resid; - struct coff_slhdr *slhdr; - char buf[128], *bufp; /* FIXME */ - unsigned int len = sh.s_size, entry_len; - - /* DPRINTF(("COFF shlib size %d offset %d\n", - sh.s_size, sh.s_scnptr)); */ - - if (len > sizeof(buf)) - return (ENOEXEC); - - error = vn_rdwr(UIO_READ, epp->ep_vp, (caddr_t) buf, - len, sh.s_scnptr, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, - &resid, p); - if (error) { - DPRINTF(("shlib section read error %d\n", error)); - return ENOEXEC; - } - bufp = buf; - while (len) { - slhdr = (struct coff_slhdr *)bufp; -#ifdef notyet - path_index = slhdr->path_index * sizeof(long); -#endif - entry_len = slhdr->entry_len * sizeof(long); - - /* DPRINTF(("path_index: %d entry_len: %d name: %s\n", - path_index, entry_len, slhdr->sl_name)); */ - - if (entry_len > len) - return (ENOEXEC); - - error = coff_load_shlib(p, slhdr->sl_name, epp); - if (error) - return ENOEXEC; - bufp += entry_len; - len -= entry_len; - } - } - - /* set up entry point */ - epp->ep_entry = ap->a_entry; - -#if 0 - DPRINTF(("text addr: %x size: %d data addr: %x size: %d entry: %x\n", - epp->ep_taddr, epp->ep_tsize, - epp->ep_daddr, epp->ep_dsize, - epp->ep_entry)); -#endif - - return exec_ibcs2_coff_setup_stack(p, epp); -} - -int -coff_load_shlib(p, path, epp) - struct proc *p; - char *path; - struct exec_package *epp; -{ - int error, taddr, tsize, daddr, dsize, offset; - size_t siz, resid; - struct nameidata nd; - struct coff_filehdr fh, *fhp = &fh; - struct coff_scnhdr sh, *shp = &sh; - caddr_t sg = stackgap_init(p->p_emul); - - /* - * 1. open shlib file - * 2. read filehdr - * 3. map text, data, and bss out of it using VM_* - */ - IBCS2_CHECK_ALT_EXIST(p, &sg, path); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, p); - /* first get the vnode */ - if ((error = namei(&nd)) != 0) { - DPRINTF(("coff_load_shlib: can't find library %s\n", path)); - return error; - } - - siz = sizeof(struct coff_filehdr); - error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t) fhp, siz, 0, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p); - if (error) { - DPRINTF(("filehdr read error %d\n", error)); - vrele(nd.ni_vp); - return error; - } - siz -= resid; - if (siz != sizeof(struct coff_filehdr)) { - DPRINTF(("coff_load_shlib: incomplete read: ask=%d, rem=%u got %u\n", - sizeof(struct coff_filehdr), resid, siz)); - vrele(nd.ni_vp); - return ENOEXEC; - } - - /* load text */ - error = coff_find_section(p, nd.ni_vp, fhp, shp, COFF_STYP_TEXT); - if (error) { - DPRINTF(("can't find shlib text section\n")); - vrele(nd.ni_vp); - return error; - } - /* DPRINTF(("COFF text addr %x size %d offset %d\n", sh.s_vaddr, - sh.s_size, sh.s_scnptr)); */ - taddr = COFF_ALIGN(shp->s_vaddr); - offset = shp->s_scnptr - (shp->s_vaddr - taddr); - tsize = shp->s_size + (shp->s_vaddr - taddr); - /* DPRINTF(("VMCMD: addr %x size %d offset %d\n", taddr, tsize, offset)); */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, tsize, taddr, - nd.ni_vp, offset, - VM_PROT_READ|VM_PROT_EXECUTE); - - /* load data */ - error = coff_find_section(p, nd.ni_vp, fhp, shp, COFF_STYP_DATA); - if (error) { - DPRINTF(("can't find shlib data section\n")); - vrele(nd.ni_vp); - return error; - } - /* DPRINTF(("COFF data addr %x size %d offset %d\n", shp->s_vaddr, - shp->s_size, shp->s_scnptr)); */ - daddr = COFF_ALIGN(shp->s_vaddr); - offset = shp->s_scnptr - (shp->s_vaddr - daddr); - dsize = shp->s_size + (shp->s_vaddr - daddr); - /* epp->ep_dsize = dsize + ap->a_bsize; */ - - /* DPRINTF(("VMCMD: addr %x size %d offset %d\n", daddr, dsize, offset)); */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, - dsize, daddr, nd.ni_vp, offset, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* load bss */ - error = coff_find_section(p, nd.ni_vp, fhp, shp, COFF_STYP_BSS); - if (!error) { - int baddr = round_page(daddr + dsize); - int bsize = daddr + dsize + shp->s_size - baddr; - if (bsize > 0) { - /* DPRINTF(("VMCMD: addr %x size %d offset %d\n", - baddr, bsize, 0)); */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, - bsize, baddr, NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - } - } - vrele(nd.ni_vp); - - return 0; -} - -int -exec_ibcs2_xout_makecmds(p, epp) - struct proc *p; - struct exec_package *epp; -{ - int error; - struct xexec *xp = epp->ep_hdr; - struct xext *xep; - - if (epp->ep_hdrvalid < XOUT_HDR_SIZE) - return ENOEXEC; - - if ((xp->x_magic != XOUT_MAGIC) || (xp->x_cpu != XC_386)) - return ENOEXEC; - if ((xp->x_renv & (XE_ABS | XE_VMOD)) || !(xp->x_renv & XE_EXEC)) - return ENOEXEC; - - xep = (struct xext *)((char *)epp->ep_hdr + sizeof(struct xexec)); -#ifdef notyet - if (xp->x_renv & XE_PURE) - error = exec_ibcs2_xout_prep_zmagic(p, epp, xp, xep); - else -#endif - error = exec_ibcs2_xout_prep_nmagic(p, epp, xp, xep); - - if (error == 0) - epp->ep_emul = &emul_ibcs2; - - if (error) - kill_vmcmds(&epp->ep_vmcmds); - - return error; -} - -/* - * exec_ibcs2_xout_prep_nmagic(): Prepare a pure x.out binary's exec package - * - */ - -int -exec_ibcs2_xout_prep_nmagic(p, epp, xp, xep) - struct proc *p; - struct exec_package *epp; - struct xexec *xp; - struct xext *xep; -{ - int error, nseg, i; - size_t resid; - long baddr, bsize; - struct xseg *xs; - - /* read in segment table */ - if (xep->xe_segsize > 16 * sizeof(*xs)) - return (ENOEXEC); - xs = (struct xseg *)malloc(xep->xe_segsize, M_TEMP, M_WAITOK); - error = vn_rdwr(UIO_READ, epp->ep_vp, (caddr_t)xs, - xep->xe_segsize, xep->xe_segpos, - UIO_SYSSPACE, 0, p->p_ucred, - &resid, p); - if (error) { - DPRINTF(("segment table read error %d\n", error)); - free(xs, M_TEMP); - return ENOEXEC; - } - - for (nseg = xep->xe_segsize / sizeof(*xs), i = 0; i < nseg; i++) { - switch (xs[i].xs_type) { - case XS_TTEXT: /* text segment */ - - DPRINTF(("text addr %x psize %d vsize %d off %d\n", - xs[i].xs_rbase, xs[i].xs_psize, - xs[i].xs_vsize, xs[i].xs_filpos)); - - epp->ep_taddr = xs[i].xs_rbase; /* XXX - align ??? */ - epp->ep_tsize = xs[i].xs_vsize; - - DPRINTF(("VMCMD: addr %x size %d offset %d\n", - epp->ep_taddr, epp->ep_tsize, - xs[i].xs_filpos)); - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, - epp->ep_tsize, epp->ep_taddr, - epp->ep_vp, xs[i].xs_filpos, - VM_PROT_READ|VM_PROT_EXECUTE); - break; - - case XS_TDATA: /* data segment */ - - DPRINTF(("data addr %x psize %d vsize %d off %d\n", - xs[i].xs_rbase, xs[i].xs_psize, - xs[i].xs_vsize, xs[i].xs_filpos)); - - epp->ep_daddr = xs[i].xs_rbase; /* XXX - align ??? */ - epp->ep_dsize = xs[i].xs_vsize; - - DPRINTF(("VMCMD: addr %x size %d offset %d\n", - epp->ep_daddr, xs[i].xs_psize, - xs[i].xs_filpos)); - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, - xs[i].xs_psize, epp->ep_daddr, - epp->ep_vp, xs[i].xs_filpos, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* set up command for bss segment */ - baddr = round_page(epp->ep_daddr + xs[i].xs_psize); - bsize = epp->ep_daddr + epp->ep_dsize - baddr; - if (bsize > 0) { - DPRINTF(("VMCMD: bss addr %x size %d off %d\n", - baddr, bsize, 0)); - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, - bsize, baddr, NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE| - VM_PROT_EXECUTE); - } - break; - - default: - break; - } - } - - /* set up entry point */ - epp->ep_entry = xp->x_entry; - - DPRINTF(("text addr: %x size: %d data addr: %x size: %d entry: %x\n", - epp->ep_taddr, epp->ep_tsize, - epp->ep_daddr, epp->ep_dsize, - epp->ep_entry)); - - free(xs, M_TEMP); - return exec_ibcs2_xout_setup_stack(p, epp); -} - -/* - * exec_ibcs2_xout_setup_stack(): Set up the stack segment for a x.out - * executable. - * - * Note that the ep_ssize parameter must be set to be the current stack - * limit; this is adjusted in the body of execve() to yield the - * appropriate stack segment usage once the argument length is - * calculated. - * - * This function returns an int for uniformity with other (future) formats' - * stack setup functions. They might have errors to return. - */ - -int -exec_ibcs2_xout_setup_stack(p, epp) - struct proc *p; - struct exec_package *epp; -{ - epp->ep_maxsaddr = USRSTACK - MAXSSIZ; - epp->ep_minsaddr = USRSTACK; - epp->ep_ssize = p->p_rlimit[RLIMIT_STACK].rlim_cur; - - /* - * set up commands for stack. note that this takes *two*, one to - * map the part of the stack which we can access, and one to map - * the part which we can't. - * - * arguably, it could be made into one, but that would require the - * addition of another mapping proc, which is unnecessary - * - * note that in memory, things assumed to be: 0 ....... ep_maxsaddr - * <stack> ep_minsaddr - */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, - ((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr), - epp->ep_maxsaddr, NULLVP, 0, VM_PROT_NONE); - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, epp->ep_ssize, - (epp->ep_minsaddr - epp->ep_ssize), NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return 0; -} diff --git a/sys/compat/ibcs2/ibcs2_exec.h b/sys/compat/ibcs2/ibcs2_exec.h deleted file mode 100644 index 94bc42b5afc..00000000000 --- a/sys/compat/ibcs2/ibcs2_exec.h +++ /dev/null @@ -1,286 +0,0 @@ -/* $OpenBSD: ibcs2_exec.h,v 1.3 2002/03/14 01:26:50 millert Exp $ */ -/* $NetBSD: ibcs2_exec.h,v 1.4 1995/03/14 15:12:24 scottb Exp $ */ - -/* - * Copyright (c) 1994, 1995 Scott Bartram - * All rights reserved. - * - * adapted from sys/sys/exec_ecoff.h - * based on Intel iBCS2 - * - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_EXEC_H_ -#define _IBCS2_EXEC_H_ - -/* - * COFF file header - */ - -struct coff_filehdr { - u_short f_magic; /* magic number */ - u_short f_nscns; /* # of sections */ - long f_timdat; /* timestamp */ - long f_symptr; /* file offset of symbol table */ - long f_nsyms; /* # of symbol table entries */ - u_short f_opthdr; /* size of optional header */ - u_short f_flags; /* flags */ -}; - -/* f_magic flags */ -#define COFF_MAGIC_I386 0x14c - -/* f_flags */ -#define COFF_F_RELFLG 0x1 -#define COFF_F_EXEC 0x2 -#define COFF_F_LNNO 0x4 -#define COFF_F_LSYMS 0x8 -#define COFF_F_SWABD 0x40 -#define COFF_F_AR16WR 0x80 -#define COFF_F_AR32WR 0x100 - -/* - * COFF system header - */ - -struct coff_aouthdr { - short a_magic; - short a_vstamp; - long a_tsize; - long a_dsize; - long a_bsize; - long a_entry; - long a_tstart; - long a_dstart; -}; - -/* magic */ -#define COFF_OMAGIC 0407 /* text not write-protected; data seg - is contiguous with text */ -#define COFF_NMAGIC 0410 /* text is write-protected; data starts - at next seg following text */ -#define COFF_ZMAGIC 0413 /* text and data segs are aligned for - direct paging */ -#define COFF_SMAGIC 0443 /* shared lib */ - -/* - * COFF section header - */ - -struct coff_scnhdr { - char s_name[8]; - long s_paddr; - long s_vaddr; - long s_size; - long s_scnptr; - long s_relptr; - long s_lnnoptr; - u_short s_nreloc; - u_short s_nlnno; - long s_flags; -}; - -/* s_flags */ -#define COFF_STYP_REG 0x00 -#define COFF_STYP_DSECT 0x01 -#define COFF_STYP_NOLOAD 0x02 -#define COFF_STYP_GROUP 0x04 -#define COFF_STYP_PAD 0x08 -#define COFF_STYP_COPY 0x10 -#define COFF_STYP_TEXT 0x20 -#define COFF_STYP_DATA 0x40 -#define COFF_STYP_BSS 0x80 -#define COFF_STYP_INFO 0x200 -#define COFF_STYP_OVER 0x400 -#define COFF_STYP_SHLIB 0x800 - -/* - * COFF shared library header - */ - -struct coff_slhdr { - long entry_len; /* in words */ - long path_index; /* in words */ - char sl_name[1]; -}; - -#define COFF_ROUND(val, by) (((val) + by - 1) & ~(by - 1)) - -#define COFF_ALIGN(a) ((a) & ~(COFF_LDPGSZ - 1)) - -#define COFF_HDR_SIZE \ - (sizeof(struct coff_filehdr) + sizeof(struct coff_aouthdr)) - -#define COFF_BLOCK_ALIGN(ap, value) \ - (ap->a_magic == COFF_ZMAGIC ? COFF_ROUND(value, COFF_LDPGSZ) : \ - value) - -#define COFF_TXTOFF(fp, ap) \ - (ap->a_magic == COFF_ZMAGIC ? 0 : \ - COFF_ROUND(COFF_HDR_SIZE + fp->f_nscns * \ - sizeof(struct coff_scnhdr), COFF_SEGMENT_ALIGNMENT(ap))) - -#define COFF_DATOFF(fp, ap) \ - (COFF_BLOCK_ALIGN(ap, COFF_TXTOFF(fp, ap) + ap->a_tsize)) - -#define COFF_SEGMENT_ALIGN(ap, value) \ - (COFF_ROUND(value, (ap->a_magic == COFF_ZMAGIC ? COFF_LDPGSZ : \ - COFF_SEGMENT_ALIGNMENT(ap)))) - -#define COFF_LDPGSZ 4096 - -#define COFF_SEGMENT_ALIGNMENT(ap) 4 - -#define COFF_BADMAG(ex) (ex->f_magic != COFF_MAGIC_I386) - -#define IBCS2_HIGH_SYSCALL(n) (((n) & 0x7f) == 0x28) -#define IBCS2_CVT_HIGH_SYSCALL(n) (((n) >> 8) + 128) - -struct exec_package; -int exec_ibcs2_coff_makecmds(struct proc *, struct exec_package *); - -/* - * x.out (XENIX) - */ - -struct xexec { - u_short x_magic; /* magic number */ - u_short x_ext; /* size of extended header */ - long x_text; /* ignored */ - long x_data; /* ignored */ - long x_bss; /* ignored */ - long x_syms; /* ignored */ - long x_reloc; /* ignored */ - long x_entry; /* executable entry point */ - char x_cpu; /* processor type */ - char x_relsym; /* ignored */ - u_short x_renv; /* flags */ -}; - -/* x_magic flags */ -#define XOUT_MAGIC 0x0206 - -/* x_cpu flags */ -#define XC_386 0x004a /* 386, word-swapped */ - -/* x_renv flags */ -#define XE_V5 0xc000 -#define XE_SEG 0x0800 -#define XE_ABS 0x0400 -#define XE_ITER 0x0200 -#define XE_VMOD 0x0100 -#define XE_FPH 0x0080 -#define XE_LTEXT 0x0040 -#define XE_LDATA 0x0020 -#define XE_OVER 0x0010 -#define XE_FS 0x0008 -#define XE_PURE 0x0004 -#define XE_SEP 0x0002 -#define XE_EXEC 0x0001 - -/* - * x.out extended header - */ - -struct xext { - long xe_trsize; /* ignored */ - long xe_drsize; /* ignored */ - long xe_tbase; /* ignored */ - long xe_dbase; /* ignored */ - long xe_stksize; /* stack size if XE_FS set in x_renv */ - long xe_segpos; /* offset of segment table */ - long xe_segsize; /* segment table size */ - long xe_mdtpos; /* ignored */ - long xe_mdtsize; /* ignored */ - char xe_mdttype; /* ignored */ - char xe_pagesize; /* ignored */ - char xe_ostype; /* ignored */ - char xe_osvers; /* ignored */ - u_short xe_eseg; /* ignored */ - u_short xe_sres; /* ignored */ -}; - -/* - * x.out segment table - */ - -struct xseg { - u_short xs_type; /* segment type */ - u_short xs_attr; /* attribute flags */ - u_short xs_seg; /* segment selector number */ - char xs_align; /* ignored */ - char xs_cres; /* ignored */ - long xs_filpos; /* offset of this segment */ - long xs_psize; /* physical segment size */ - long xs_vsize; /* virtual segment size */ - long xs_rbase; /* relocation base address */ - u_short xs_noff; /* ignored */ - u_short xs_sres; /* ignored */ - long xs_lres; /* ignored */ -}; - -/* xs_type flags */ -#define XS_TNULL 0 /* unused */ -#define XS_TTEXT 1 /* text (read-only) */ -#define XS_TDATA 2 /* data (read-write) */ -#define XS_TSYMS 3 /* symbol table (noload) */ -#define XS_TREL 4 /* relocation segment (noload) */ -#define XS_TSESTR 5 /* string table (noload) */ -#define XS_TGRPS 6 /* group segment (noload) */ - -#define XS_TIDATA 64 -#define XS_TTSS 65 -#define XS_TLFIX 66 -#define XS_TDNAME 67 -#define XS_TDTEXT 68 -#define XS_TDFIX 69 -#define XS_TOVTAB 70 -#define XS_T71 71 -#define XS_TSYSTR 72 - -/* xs_attr flags */ -#define XS_AMEM 0x8000 /* memory image */ -#define XS_AITER 0x0001 /* iteration records */ -#define XS_AHUGE 0x0002 /* unused */ -#define XS_ABSS 0x0004 /* uninitialized data */ -#define XS_APURE 0x0008 /* read-only (sharable) segment */ -#define XS_AEDOWN 0x0010 /* expand down memory segment */ -#define XS_APRIV 0x0020 /* unused */ -#define XS_A32BIT 0x0040 /* 32-bit text/data */ - -/* - * x.out iteration record - */ - -struct xiter { - long xi_size; /* text/data size */ - long xi_rep; /* number of replications */ - long xi_offset; /* offset within segment to replicated data */ -}; - -#define XOUT_HDR_SIZE (sizeof(struct xexec) + sizeof(struct xext)) - -int exec_ibcs2_xout_makecmds(struct proc *, struct exec_package *); - -#endif /* !_IBCS2_EXEC_H_ */ diff --git a/sys/compat/ibcs2/ibcs2_fcntl.c b/sys/compat/ibcs2/ibcs2_fcntl.c deleted file mode 100644 index e2c1f3b1b88..00000000000 --- a/sys/compat/ibcs2/ibcs2_fcntl.c +++ /dev/null @@ -1,432 +0,0 @@ -/* $OpenBSD: ibcs2_fcntl.c,v 1.9 2002/03/14 01:26:50 millert Exp $ */ -/* $NetBSD: ibcs2_fcntl.c,v 1.6 1996/05/03 17:05:20 christos Exp $ */ - -/* - * Copyright (c) 1997 Theo de Raadt - * Copyright (c) 1995 Scott Bartram - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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/systm.h> -#include <sys/namei.h> -#include <sys/proc.h> -#include <sys/file.h> -#include <sys/stat.h> -#include <sys/filedesc.h> -#include <sys/ioctl.h> -#include <sys/kernel.h> -#include <sys/mount.h> -#include <sys/malloc.h> -#include <sys/syscallargs.h> -#include <sys/vnode.h> - -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_fcntl.h> -#include <compat/ibcs2/ibcs2_unistd.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_syscallargs.h> -#include <compat/ibcs2/ibcs2_util.h> - -static int cvt_o_flags(int); -static void cvt_flock2iflock(struct flock *, struct ibcs2_flock *); -static void cvt_iflock2flock(struct ibcs2_flock *, struct flock *); -static int ioflags2oflags(int); -static int oflags2ioflags(int); - -static int -cvt_o_flags(flags) - int flags; -{ - int r = 0; - - /* convert mode into NetBSD mode */ - if (flags & IBCS2_O_WRONLY) r |= O_WRONLY; - if (flags & IBCS2_O_RDWR) r |= O_RDWR; - if (flags & (IBCS2_O_NDELAY | IBCS2_O_NONBLOCK)) r |= O_NONBLOCK; - if (flags & IBCS2_O_APPEND) r |= O_APPEND; - if (flags & IBCS2_O_SYNC) r |= O_SYNC; - if (flags & IBCS2_O_CREAT) r |= O_CREAT; - if (flags & IBCS2_O_TRUNC) r |= O_TRUNC; - if (flags & IBCS2_O_EXCL) r |= O_EXCL; - return r; -} - -static void -cvt_flock2iflock(flp, iflp) - struct flock *flp; - struct ibcs2_flock *iflp; -{ - switch (flp->l_type) { - case F_RDLCK: - iflp->l_type = IBCS2_F_RDLCK; - break; - case F_WRLCK: - iflp->l_type = IBCS2_F_WRLCK; - break; - case F_UNLCK: - iflp->l_type = IBCS2_F_UNLCK; - break; - } - iflp->l_whence = (short)flp->l_whence; - iflp->l_start = (ibcs2_off_t)flp->l_start; - iflp->l_len = (ibcs2_off_t)flp->l_len; - iflp->l_sysid = 0; - iflp->l_pid = (ibcs2_pid_t)flp->l_pid; -} - -static void -cvt_iflock2flock(iflp, flp) - struct ibcs2_flock *iflp; - struct flock *flp; -{ - flp->l_start = (off_t)iflp->l_start; - flp->l_len = (off_t)iflp->l_len; - flp->l_pid = (pid_t)iflp->l_pid; - switch (iflp->l_type) { - case IBCS2_F_RDLCK: - flp->l_type = F_RDLCK; - break; - case IBCS2_F_WRLCK: - flp->l_type = F_WRLCK; - break; - case IBCS2_F_UNLCK: - flp->l_type = F_UNLCK; - break; - } - flp->l_whence = iflp->l_whence; -} - -/* convert iBCS2 mode into NetBSD mode */ -static int -ioflags2oflags(flags) - int flags; -{ - int r = 0; - - if (flags & IBCS2_O_RDONLY) r |= O_RDONLY; - if (flags & IBCS2_O_WRONLY) r |= O_WRONLY; - if (flags & IBCS2_O_RDWR) r |= O_RDWR; - if (flags & IBCS2_O_NDELAY) r |= O_NONBLOCK; - if (flags & IBCS2_O_APPEND) r |= O_APPEND; - if (flags & IBCS2_O_SYNC) r |= O_SYNC; - if (flags & IBCS2_O_NONBLOCK) r |= O_NONBLOCK; - if (flags & IBCS2_O_CREAT) r |= O_CREAT; - if (flags & IBCS2_O_TRUNC) r |= O_TRUNC; - if (flags & IBCS2_O_EXCL) r |= O_EXCL; - if (flags & IBCS2_O_NOCTTY) r |= O_NOCTTY; - return r; -} - -/* convert NetBSD mode into iBCS2 mode */ -static int -oflags2ioflags(flags) - int flags; -{ - int r = 0; - - if (flags & O_RDONLY) r |= IBCS2_O_RDONLY; - if (flags & O_WRONLY) r |= IBCS2_O_WRONLY; - if (flags & O_RDWR) r |= IBCS2_O_RDWR; - if (flags & O_NDELAY) r |= IBCS2_O_NONBLOCK; - if (flags & O_APPEND) r |= IBCS2_O_APPEND; - if (flags & O_SYNC) r |= IBCS2_O_SYNC; - if (flags & O_NONBLOCK) r |= IBCS2_O_NONBLOCK; - if (flags & O_CREAT) r |= IBCS2_O_CREAT; - if (flags & O_TRUNC) r |= IBCS2_O_TRUNC; - if (flags & O_EXCL) r |= IBCS2_O_EXCL; - if (flags & O_NOCTTY) r |= IBCS2_O_NOCTTY; - return r; -} - -int -ibcs2_sys_open(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_open_args /* { - syscallarg(char *) path; - syscallarg(int) flags; - syscallarg(int) mode; - } */ *uap = v; - int noctty = SCARG(uap, flags) & IBCS2_O_NOCTTY; - int ret; - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(uap, flags) = cvt_o_flags(SCARG(uap, flags)); - if (SCARG(uap, flags) & O_CREAT) - IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); - else - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - ret = sys_open(p, uap, retval); - - if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { - struct filedesc *fdp = p->p_fd; - struct file *fp; - - if ((fp = fd_getfile(fdp, *retval)) == NULL) - return EBADF; - FREF(fp); - if (fp->f_type == DTYPE_VNODE) - (fp->f_ops->fo_ioctl)(fp, TIOCSCTTY, (caddr_t) 0, p); - FRELE(fp); - } - return ret; -} - -int -ibcs2_sys_creat(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_creat_args /* { - syscallarg(char *) path; - syscallarg(int) mode; - } */ *uap = v; - struct sys_open_args cup; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, mode) = SCARG(uap, mode); - SCARG(&cup, flags) = O_WRONLY | O_CREAT | O_TRUNC; - return sys_open(p, &cup, retval); -} - -int -ibcs2_sys_access(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_access_args /* { - syscallarg(char *) path; - syscallarg(int) flags; - } */ *uap = v; - struct sys_access_args cup; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, flags) = SCARG(uap, flags); - return sys_access(p, &cup, retval); -} - -int -ibcs2_sys_eaccess(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - register struct ibcs2_sys_eaccess_args /* { - syscallarg(char *) path; - syscallarg(int) flags; - } */ *uap = v; - register struct ucred *cred = p->p_ucred; - register struct vnode *vp; - int error, flags; - struct nameidata nd; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, - SCARG(uap, path), p); - if ((error = namei(&nd)) != 0) - return error; - vp = nd.ni_vp; - - /* Flags == 0 means only check for existence. */ - if (SCARG(uap, flags)) { - flags = 0; - if (SCARG(uap, flags) & IBCS2_R_OK) - flags |= VREAD; - if (SCARG(uap, flags) & IBCS2_W_OK) - flags |= VWRITE; - if (SCARG(uap, flags) & IBCS2_X_OK) - flags |= VEXEC; - if ((flags & VWRITE) == 0 || (error = vn_writechk(vp)) == 0) - error = VOP_ACCESS(vp, flags, cred, p); - } - vput(vp); - return error; -} - -int -ibcs2_sys_fcntl(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_fcntl_args /* { - syscallarg(int) fd; - syscallarg(int) cmd; - syscallarg(char *) arg; - } */ *uap = v; - int error; - struct sys_fcntl_args fa; - struct flock *flp; - struct ibcs2_flock ifl; - - switch(SCARG(uap, cmd)) { - case IBCS2_F_DUPFD: - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = F_DUPFD; - SCARG(&fa, arg) = SCARG(uap, arg); - return sys_fcntl(p, &fa, retval); - case IBCS2_F_GETFD: - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = F_GETFD; - SCARG(&fa, arg) = SCARG(uap, arg); - return sys_fcntl(p, &fa, retval); - case IBCS2_F_SETFD: - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = F_SETFD; - SCARG(&fa, arg) = SCARG(uap, arg); - return sys_fcntl(p, &fa, retval); - case IBCS2_F_GETFL: - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = F_GETFL; - SCARG(&fa, arg) = SCARG(uap, arg); - error = sys_fcntl(p, &fa, retval); - if (error) - return error; - *retval = oflags2ioflags(*retval); - return error; - case IBCS2_F_SETFL: - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = F_SETFL; - SCARG(&fa, arg) = (void *)ioflags2oflags((int) SCARG(uap, arg)); - return sys_fcntl(p, &fa, retval); - - case IBCS2_F_GETLK: - { - caddr_t sg = stackgap_init(p->p_emul); - flp = stackgap_alloc(&sg, sizeof(*flp)); - error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&ifl, - ibcs2_flock_len); - if (error) - return error; - cvt_iflock2flock(&ifl, flp); - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = F_GETLK; - SCARG(&fa, arg) = (void *)flp; - error = sys_fcntl(p, &fa, retval); - if (error) - return error; - cvt_flock2iflock(flp, &ifl); - return copyout((caddr_t)&ifl, (caddr_t)SCARG(uap, arg), - ibcs2_flock_len); - } - - case IBCS2_F_SETLK: - { - caddr_t sg = stackgap_init(p->p_emul); - flp = stackgap_alloc(&sg, sizeof(*flp)); - error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&ifl, - ibcs2_flock_len); - if (error) - return error; - cvt_iflock2flock(&ifl, flp); - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = F_SETLK; - SCARG(&fa, arg) = (void *)flp; - return sys_fcntl(p, &fa, retval); - } - - case IBCS2_F_SETLKW: - { - caddr_t sg = stackgap_init(p->p_emul); - flp = stackgap_alloc(&sg, sizeof(*flp)); - error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&ifl, - ibcs2_flock_len); - if (error) - return error; - cvt_iflock2flock(&ifl, flp); - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = F_SETLKW; - SCARG(&fa, arg) = (void *)flp; - return sys_fcntl(p, &fa, retval); - } - case IBCS2_F_FREESP: - { - struct ibcs2_flock ifl; - off_t off, cur; - caddr_t sg = stackgap_init(p->p_emul); - struct sys_fstat_args ofst; - struct stat ost; - struct sys_lseek_args ols; - struct sys_ftruncate_args /* { - syscallarg(int) fd; - syscallarg(int) pad; - syscallarg(off_t) length; - } */ nuap; - - error = copyin(SCARG(uap, arg), &ifl, sizeof ifl); - if (error) - return error; - - SCARG(&ofst, fd) = SCARG(uap, fd); - SCARG(&ofst, sb) = stackgap_alloc(&sg, - sizeof(struct stat)); - if ((error = sys_fstat(p, &ofst, retval)) != 0) - return error; - if ((error = copyin(SCARG(&ofst, sb), &ost, - sizeof ost)) != 0) - return error; - - SCARG(&ols, fd) = SCARG(uap, fd); - SCARG(&ols, whence) = SEEK_CUR; - SCARG(&ols, offset) = 0; - if ((error = sys_lseek(p, &ols, (register_t *)&cur)) != 0) - return error; - - off = (off_t)ifl.l_start; - switch (ifl.l_whence) { - case 0: - off = (off_t)ifl.l_start; - break; - case 1: - off = ost.st_size + (off_t)ifl.l_start; - break; - case 2: - off = cur - (off_t)ifl.l_start; - break; - default: - return EINVAL; - } - - if (ifl.l_len != 0 && off + ifl.l_len != ost.st_size) - return EINVAL; /* Sorry, cannot truncate in middle */ - - SCARG(&nuap, fd) = SCARG(uap, fd); - SCARG(&nuap, length) = off; - return (sys_ftruncate(p, &nuap, retval)); - } - } - return ENOSYS; -} diff --git a/sys/compat/ibcs2/ibcs2_fcntl.h b/sys/compat/ibcs2/ibcs2_fcntl.h deleted file mode 100644 index d8e7b273e0b..00000000000 --- a/sys/compat/ibcs2/ibcs2_fcntl.h +++ /dev/null @@ -1,78 +0,0 @@ -/* $OpenBSD: ibcs2_fcntl.h,v 1.3 1997/12/20 16:04:08 deraadt Exp $ */ -/* $NetBSD: ibcs2_fcntl.h,v 1.2 1994/10/26 02:52:54 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_FCNTL_H -#define _IBCS2_FCNTL_H 1 - -#include <compat/ibcs2/ibcs2_types.h> - -#define IBCS2_O_RDONLY 0x0000 -#define IBCS2_O_WRONLY 0x0001 -#define IBCS2_O_RDWR 0x0002 -#define IBCS2_O_NDELAY 0x0004 -#define IBCS2_O_APPEND 0x0008 -#define IBCS2_O_SYNC 0x0010 -#define IBCS2_O_NONBLOCK 0x0080 -#define IBCS2_O_CREAT 0x0100 -#define IBCS2_O_TRUNC 0x0200 -#define IBCS2_O_EXCL 0x0400 -#define IBCS2_O_NOCTTY 0x0800 - -#define IBCS2_F_DUPFD 0 -#define IBCS2_F_GETFD 1 -#define IBCS2_F_SETFD 2 -#define IBCS2_F_GETFL 3 -#define IBCS2_F_SETFL 4 -#define IBCS2_F_GETLK 5 -#define IBCS2_F_SETLK 6 -#define IBCS2_F_SETLKW 7 -#define IBCS2_F_FREESP 11 - -struct ibcs2_flock { - short l_type; - short l_whence; - ibcs2_off_t l_start; - ibcs2_off_t l_len; - short l_sysid; - ibcs2_pid_t l_pid; -}; -#define ibcs2_flock_len (sizeof(struct ibcs2_flock)) - -#define IBCS2_F_RDLCK 1 -#define IBCS2_F_WRLCK 2 -#define IBCS2_F_UNLCK 3 - -#define IBCS2_O_ACCMODE 3 -#define IBCS2_FD_CLOEXEC 1 - -#endif /* _IBCS2_FCNTL_H */ diff --git a/sys/compat/ibcs2/ibcs2_grp.h b/sys/compat/ibcs2/ibcs2_grp.h deleted file mode 100644 index 6a453d10b6c..00000000000 --- a/sys/compat/ibcs2/ibcs2_grp.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $OpenBSD: ibcs2_grp.h,v 1.2 1996/08/02 20:35:06 niklas Exp $ */ -/* $NetBSD: ibcs2_grp.h,v 1.2 1994/10/26 02:52:55 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_GRP_H -#define _IBCS2_GRP_H - -struct ibcs2_group { - char *gr_name; - char *gr_passwd; - char *gr_gid; - char **gr_mem; -}; - -#endif /* _IBCS2_GRP_H */ diff --git a/sys/compat/ibcs2/ibcs2_ioctl.c b/sys/compat/ibcs2/ibcs2_ioctl.c deleted file mode 100644 index 90bac72aaeb..00000000000 --- a/sys/compat/ibcs2/ibcs2_ioctl.c +++ /dev/null @@ -1,573 +0,0 @@ -/* $OpenBSD: ibcs2_ioctl.c,v 1.12 2004/09/19 21:34:42 mickey Exp $ */ -/* $NetBSD: ibcs2_ioctl.c,v 1.12 1996/08/10 09:08:26 mycroft Exp $ */ - -/* - * Copyright (c) 1994, 1995 Scott Bartram - * All rights reserved. - * - * based on compat/sunos/sun_ioctl.c - * - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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/systm.h> -#include <sys/namei.h> -#include <sys/dirent.h> -#include <sys/proc.h> -#include <sys/file.h> -#include <sys/stat.h> -#include <sys/filedesc.h> -#include <sys/ioctl.h> -#include <sys/kernel.h> -#include <sys/malloc.h> -#include <sys/mbuf.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/reboot.h> -#include <sys/resource.h> -#include <sys/resourcevar.h> -#include <sys/signal.h> -#include <sys/signalvar.h> -#include <sys/socket.h> -#include <sys/termios.h> -#include <sys/time.h> -#include <sys/times.h> -#include <sys/tty.h> -#include <sys/vnode.h> -#include <sys/uio.h> -#include <sys/wait.h> -#include <sys/utsname.h> -#include <sys/unistd.h> - -#include <net/if.h> -#include <sys/syscallargs.h> - -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_socksys.h> -#include <compat/ibcs2/ibcs2_stropts.h> -#include <compat/ibcs2/ibcs2_syscallargs.h> -#include <compat/ibcs2/ibcs2_termios.h> -#include <compat/ibcs2/ibcs2_util.h> - -/* - * iBCS2 ioctl calls. - */ - -static const struct speedtab sptab[] = { - { 0, 0 }, - { 50, 1 }, - { 75, 2 }, - { 110, 3 }, - { 134, 4 }, - { 135, 4 }, - { 150, 5 }, - { 200, 6 }, - { 300, 7 }, - { 600, 8 }, - { 1200, 9 }, - { 1800, 10 }, - { 2400, 11 }, - { 4800, 12 }, - { 9600, 13 }, - { 19200, 14 }, - { 38400, 15 }, - { -1, -1 } -}; - -static const u_long s2btab[] = { - 0, - 50, - 75, - 110, - 134, - 150, - 200, - 300, - 600, - 1200, - 1800, - 2400, - 4800, - 9600, - 19200, - 38400, -}; - -static void stios2btios(struct ibcs2_termios *, struct termios *); -static void btios2stios(struct termios *, struct ibcs2_termios *); -static void stios2stio(struct ibcs2_termios *, struct ibcs2_termio *); -static void stio2stios(struct ibcs2_termio *, struct ibcs2_termios *); - -static void -stios2btios(st, bt) - struct ibcs2_termios *st; - struct termios *bt; -{ - register u_long l, r; - - l = st->c_iflag; r = 0; - if (l & IBCS2_IGNBRK) r |= IGNBRK; - if (l & IBCS2_BRKINT) r |= BRKINT; - if (l & IBCS2_IGNPAR) r |= IGNPAR; - if (l & IBCS2_PARMRK) r |= PARMRK; - if (l & IBCS2_INPCK) r |= INPCK; - if (l & IBCS2_ISTRIP) r |= ISTRIP; - if (l & IBCS2_INLCR) r |= INLCR; - if (l & IBCS2_IGNCR) r |= IGNCR; - if (l & IBCS2_ICRNL) r |= ICRNL; - if (l & IBCS2_IXON) r |= IXON; - if (l & IBCS2_IXANY) r |= IXANY; - if (l & IBCS2_IXOFF) r |= IXOFF; - if (l & IBCS2_IMAXBEL) r |= IMAXBEL; - bt->c_iflag = r; - - l = st->c_oflag; r = 0; - if (l & IBCS2_OPOST) r |= OPOST; - if (l & IBCS2_ONLCR) r |= ONLCR; - if (l & IBCS2_TAB3) r |= OXTABS; - bt->c_oflag = r; - - l = st->c_cflag; r = 0; - switch (l & IBCS2_CSIZE) { - case IBCS2_CS5: r |= CS5; break; - case IBCS2_CS6: r |= CS6; break; - case IBCS2_CS7: r |= CS7; break; - case IBCS2_CS8: r |= CS8; break; - } - if (l & IBCS2_CSTOPB) r |= CSTOPB; - if (l & IBCS2_CREAD) r |= CREAD; - if (l & IBCS2_PARENB) r |= PARENB; - if (l & IBCS2_PARODD) r |= PARODD; - if (l & IBCS2_HUPCL) r |= HUPCL; - if (l & IBCS2_CLOCAL) r |= CLOCAL; - bt->c_cflag = r; - - l = st->c_lflag; r = 0; - if (l & IBCS2_ISIG) r |= ISIG; - if (l & IBCS2_ICANON) r |= ICANON; - if (l & IBCS2_ECHO) r |= ECHO; - if (l & IBCS2_ECHOE) r |= ECHOE; - if (l & IBCS2_ECHOK) r |= ECHOK; - if (l & IBCS2_ECHONL) r |= ECHONL; - if (l & IBCS2_NOFLSH) r |= NOFLSH; - if (l & IBCS2_TOSTOP) r |= TOSTOP; - bt->c_lflag = r; - - bt->c_ispeed = bt->c_ospeed = s2btab[l & 0x0000000f]; - - bt->c_cc[VINTR] = - st->c_cc[IBCS2_VINTR] ? st->c_cc[IBCS2_VINTR] : _POSIX_VDISABLE; - bt->c_cc[VQUIT] = - st->c_cc[IBCS2_VQUIT] ? st->c_cc[IBCS2_VQUIT] : _POSIX_VDISABLE; - bt->c_cc[VERASE] = - st->c_cc[IBCS2_VERASE] ? st->c_cc[IBCS2_VERASE] : _POSIX_VDISABLE; - bt->c_cc[VKILL] = - st->c_cc[IBCS2_VKILL] ? st->c_cc[IBCS2_VKILL] : _POSIX_VDISABLE; - if (bt->c_lflag & ICANON) { - bt->c_cc[VEOF] = - st->c_cc[IBCS2_VEOF] ? st->c_cc[IBCS2_VEOF] : _POSIX_VDISABLE; - bt->c_cc[VEOL] = - st->c_cc[IBCS2_VEOL] ? st->c_cc[IBCS2_VEOL] : _POSIX_VDISABLE; - } else { - bt->c_cc[VMIN] = st->c_cc[IBCS2_VMIN]; - bt->c_cc[VTIME] = st->c_cc[IBCS2_VTIME]; - } - bt->c_cc[VEOL2] = - st->c_cc[IBCS2_VEOL2] ? st->c_cc[IBCS2_VEOL2] : _POSIX_VDISABLE; -#if 0 - bt->c_cc[VSWTCH] = - st->c_cc[IBCS2_VSWTCH] ? st->c_cc[IBCS2_VSWTCH] : _POSIX_VDISABLE; -#endif - bt->c_cc[VSTART] = - st->c_cc[IBCS2_VSTART] ? st->c_cc[IBCS2_VSTART] : _POSIX_VDISABLE; - bt->c_cc[VSTOP] = - st->c_cc[IBCS2_VSTOP] ? st->c_cc[IBCS2_VSTOP] : _POSIX_VDISABLE; - bt->c_cc[VSUSP] = - st->c_cc[IBCS2_VSUSP] ? st->c_cc[IBCS2_VSUSP] : _POSIX_VDISABLE; - bt->c_cc[VDSUSP] = _POSIX_VDISABLE; - bt->c_cc[VREPRINT] = _POSIX_VDISABLE; - bt->c_cc[VDISCARD] = _POSIX_VDISABLE; - bt->c_cc[VWERASE] = _POSIX_VDISABLE; - bt->c_cc[VLNEXT] = _POSIX_VDISABLE; - bt->c_cc[VSTATUS] = _POSIX_VDISABLE; -} - -static void -btios2stios(bt, st) - struct termios *bt; - struct ibcs2_termios *st; -{ - register u_long l, r; - - l = bt->c_iflag; r = 0; - if (l & IGNBRK) r |= IBCS2_IGNBRK; - if (l & BRKINT) r |= IBCS2_BRKINT; - if (l & IGNPAR) r |= IBCS2_IGNPAR; - if (l & PARMRK) r |= IBCS2_PARMRK; - if (l & INPCK) r |= IBCS2_INPCK; - if (l & ISTRIP) r |= IBCS2_ISTRIP; - if (l & INLCR) r |= IBCS2_INLCR; - if (l & IGNCR) r |= IBCS2_IGNCR; - if (l & ICRNL) r |= IBCS2_ICRNL; - if (l & IXON) r |= IBCS2_IXON; - if (l & IXANY) r |= IBCS2_IXANY; - if (l & IXOFF) r |= IBCS2_IXOFF; - if (l & IMAXBEL) r |= IBCS2_IMAXBEL; - st->c_iflag = r; - - l = bt->c_oflag; r = 0; - if (l & OPOST) r |= IBCS2_OPOST; - if (l & ONLCR) r |= IBCS2_ONLCR; - if (l & OXTABS) r |= IBCS2_TAB3; - st->c_oflag = r; - - l = bt->c_cflag; r = 0; - switch (l & CSIZE) { - case CS5: r |= IBCS2_CS5; break; - case CS6: r |= IBCS2_CS6; break; - case CS7: r |= IBCS2_CS7; break; - case CS8: r |= IBCS2_CS8; break; - } - if (l & CSTOPB) r |= IBCS2_CSTOPB; - if (l & CREAD) r |= IBCS2_CREAD; - if (l & PARENB) r |= IBCS2_PARENB; - if (l & PARODD) r |= IBCS2_PARODD; - if (l & HUPCL) r |= IBCS2_HUPCL; - if (l & CLOCAL) r |= IBCS2_CLOCAL; - st->c_cflag = r; - - l = bt->c_lflag; r = 0; - if (l & ISIG) r |= IBCS2_ISIG; - if (l & ICANON) r |= IBCS2_ICANON; - if (l & ECHO) r |= IBCS2_ECHO; - if (l & ECHOE) r |= IBCS2_ECHOE; - if (l & ECHOK) r |= IBCS2_ECHOK; - if (l & ECHONL) r |= IBCS2_ECHONL; - if (l & NOFLSH) r |= IBCS2_NOFLSH; - if (l & TOSTOP) r |= IBCS2_TOSTOP; - st->c_lflag = r; - - l = ttspeedtab(bt->c_ospeed, sptab); - if (l >= 0) - st->c_cflag |= l; - - st->c_cc[IBCS2_VINTR] = - bt->c_cc[VINTR] != _POSIX_VDISABLE ? bt->c_cc[VINTR] : 0; - st->c_cc[IBCS2_VQUIT] = - bt->c_cc[VQUIT] != _POSIX_VDISABLE ? bt->c_cc[VQUIT] : 0; - st->c_cc[IBCS2_VERASE] = - bt->c_cc[VERASE] != _POSIX_VDISABLE ? bt->c_cc[VERASE] : 0; - st->c_cc[IBCS2_VKILL] = - bt->c_cc[VKILL] != _POSIX_VDISABLE ? bt->c_cc[VKILL] : 0; - if (bt->c_lflag & ICANON) { - st->c_cc[IBCS2_VEOF] = - bt->c_cc[VEOF] != _POSIX_VDISABLE ? bt->c_cc[VEOF] : 0; - st->c_cc[IBCS2_VEOL] = - bt->c_cc[VEOL] != _POSIX_VDISABLE ? bt->c_cc[VEOL] : 0; - } else { - st->c_cc[IBCS2_VMIN] = bt->c_cc[VMIN]; - st->c_cc[IBCS2_VTIME] = bt->c_cc[VTIME]; - } - st->c_cc[IBCS2_VEOL2] = - bt->c_cc[VEOL2] != _POSIX_VDISABLE ? bt->c_cc[VEOL2] : 0; - st->c_cc[IBCS2_VSWTCH] = - 0; - st->c_cc[IBCS2_VSUSP] = - bt->c_cc[VSUSP] != _POSIX_VDISABLE ? bt->c_cc[VSUSP] : 0; - st->c_cc[IBCS2_VSTART] = - bt->c_cc[VSTART] != _POSIX_VDISABLE ? bt->c_cc[VSTART] : 0; - st->c_cc[IBCS2_VSTOP] = - bt->c_cc[VSTOP] != _POSIX_VDISABLE ? bt->c_cc[VSTOP] : 0; - - st->c_line = 0; -} - -static void -stios2stio(ts, t) - struct ibcs2_termios *ts; - struct ibcs2_termio *t; -{ - - t->c_iflag = ts->c_iflag; - t->c_oflag = ts->c_oflag; - t->c_cflag = ts->c_cflag; - t->c_lflag = ts->c_lflag; - t->c_line = ts->c_line; - bcopy(ts->c_cc, t->c_cc, IBCS2_NCC); -} - -static void -stio2stios(t, ts) - struct ibcs2_termio *t; - struct ibcs2_termios *ts; -{ - - ts->c_iflag = t->c_iflag; - ts->c_oflag = t->c_oflag; - ts->c_cflag = t->c_cflag; - ts->c_lflag = t->c_lflag; - ts->c_line = t->c_line; - bcopy(t->c_cc, ts->c_cc, IBCS2_NCC); -} - -int -ibcs2_sys_ioctl(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_ioctl_args /* { - syscallarg(int) fd; - syscallarg(int) cmd; - syscallarg(caddr_t) data; - } */ *uap = v; - struct filedesc *fdp = p->p_fd; - struct file *fp; - int (*ctl)(struct file *, u_long, caddr_t, struct proc *); - int error; - - if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL) - return (EBADF); - FREF(fp); - - if ((fp->f_flag & (FREAD|FWRITE)) == 0) { - DPRINTF(("ibcs2_ioctl(%d): bad fp flag ", p->p_pid)); - error = EBADF; - goto out; - } - - ctl = fp->f_ops->fo_ioctl; - - switch (SCARG(uap, cmd)) { - case IBCS2_TCGETA: - case IBCS2_XCGETA: - case IBCS2_OXCGETA: - { - struct termios bts; - struct ibcs2_termios sts; - struct ibcs2_termio st; - - if ((error = (*ctl)(fp, TIOCGETA, (caddr_t)&bts, p)) != 0) - goto out; - - btios2stios (&bts, &sts); - if (SCARG(uap, cmd) == IBCS2_TCGETA) { - stios2stio (&sts, &st); - error = copyout((caddr_t)&st, SCARG(uap, data), - sizeof (st)); - if (error) - DPRINTF(("ibcs2_ioctl(%d): copyout failed ", - p->p_pid)); - goto out; - } else { - error = copyout((caddr_t)&sts, SCARG(uap, data), - sizeof (sts)); - goto out; - } - /*NOTREACHED*/ - } - - case IBCS2_TCSETA: - case IBCS2_TCSETAW: - case IBCS2_TCSETAF: - { - struct termios bts; - struct ibcs2_termios sts; - struct ibcs2_termio st; - - if ((error = copyin(SCARG(uap, data), (caddr_t)&st, - sizeof(st))) != 0) { - DPRINTF(("ibcs2_ioctl(%d): TCSET copyin failed ", - p->p_pid)); - goto out; - } - - /* get full BSD termios so we don't lose information */ - if ((error = (*ctl)(fp, TIOCGETA, (caddr_t)&bts, p)) != 0) { - DPRINTF(("ibcs2_ioctl(%d): TCSET ctl failed fd %d ", - p->p_pid, SCARG(uap, fd))); - goto out; - } - - /* - * convert to iBCS2 termios, copy in information from - * termio, and convert back, then set new values. - */ - btios2stios(&bts, &sts); - stio2stios(&st, &sts); - stios2btios(&sts, &bts); - - error = (*ctl)(fp, SCARG(uap, cmd) - IBCS2_TCSETA + TIOCSETA, - (caddr_t)&bts, p); - goto out; - } - - case IBCS2_XCSETA: - case IBCS2_XCSETAW: - case IBCS2_XCSETAF: - { - struct termios bts; - struct ibcs2_termios sts; - - if ((error = copyin(SCARG(uap, data), (caddr_t)&sts, - sizeof (sts))) != 0) { - goto out; - } - stios2btios (&sts, &bts); - error = (*ctl)(fp, SCARG(uap, cmd) - IBCS2_XCSETA + TIOCSETA, - (caddr_t)&bts, p); - goto out; - } - - case IBCS2_OXCSETA: - case IBCS2_OXCSETAW: - case IBCS2_OXCSETAF: - { - struct termios bts; - struct ibcs2_termios sts; - - if ((error = copyin(SCARG(uap, data), (caddr_t)&sts, - sizeof (sts))) != 0) { - goto out; - } - stios2btios (&sts, &bts); - error = (*ctl)(fp, SCARG(uap, cmd) - IBCS2_OXCSETA + TIOCSETA, - (caddr_t)&bts, p); - goto out; - } - - case IBCS2_TCSBRK: - DPRINTF(("ibcs2_ioctl(%d): TCSBRK ", p->p_pid)); - error = ENOSYS; - goto out; - - case IBCS2_TCXONC: - { - switch ((int)SCARG(uap, data)) { - case 0: - case 1: - DPRINTF(("ibcs2_ioctl(%d): TCXONC ", p->p_pid)); - error = ENOSYS; - goto out; - case 2: - error = (*ctl)(fp, TIOCSTOP, (caddr_t)0, p); - goto out; - case 3: - error = (*ctl)(fp, TIOCSTART, (caddr_t)1, p); - goto out; - default: - error = EINVAL; - goto out; - } - } - - case IBCS2_TCFLSH: - { - int arg; - - switch ((int)SCARG(uap, data)) { - case 0: - arg = FREAD; - break; - case 1: - arg = FWRITE; - break; - case 2: - arg = FREAD | FWRITE; - break; - default: - error = EINVAL; - goto out; - } - error = (*ctl)(fp, TIOCFLUSH, (caddr_t)&arg, p); - goto out; - } - - case IBCS2_TIOCGWINSZ: - SCARG(uap, cmd) = TIOCGWINSZ; - error = sys_ioctl(p, uap, retval); - goto out; - - case IBCS2_TIOCSWINSZ: - SCARG(uap, cmd) = TIOCSWINSZ; - error = sys_ioctl(p, uap, retval); - goto out; - - case IBCS2_TIOCGPGRP: - error = copyout((caddr_t)&p->p_pgrp->pg_id, SCARG(uap, data), - sizeof(p->p_pgrp->pg_id)); - goto out; - - case IBCS2_TIOCSPGRP: /* XXX - is uap->data a pointer to pgid? */ - { - struct sys_setpgid_args sa; - - SCARG(&sa, pid) = 0; - SCARG(&sa, pgid) = (int)SCARG(uap, data); - if ((error = sys_setpgid(p, &sa, retval)) != 0) - goto out; - error = 0; - goto out; - } - - case IBCS2_TCGETSC: /* SCO console - get scancode flags */ - error = ENOSYS; - goto out; - - case IBCS2_TCSETSC: /* SCO console - set scancode flags */ - error = ENOSYS; - goto out; - - case IBCS2_SIOCSOCKSYS: - error = ibcs2_socksys(p, uap, retval); - goto out; - - case IBCS2_FIONBIO: - { - int arg; - - if ((error = copyin(SCARG(uap, data), &arg, - sizeof(arg))) != 0) - goto out; - - error = (*ctl)(fp, FIONBIO, (caddr_t)&arg, p); - goto out; - } - case IBCS2_FIONREAD: - case IBCS2_I_NREAD: /* STREAMS */ - SCARG(uap, cmd) = FIONREAD; - error = sys_ioctl(p, uap, retval); - goto out; - - default: - DPRINTF(("ibcs2_ioctl(%d): unknown cmd 0x%lx ", - p->p_pid, SCARG(uap, cmd))); - error = ENOSYS; - goto out; - } - error = ENOSYS; - -out: - FRELE(fp); - return (error); -} - diff --git a/sys/compat/ibcs2/ibcs2_ipc.c b/sys/compat/ibcs2/ibcs2_ipc.c deleted file mode 100644 index 4d05b19a8c8..00000000000 --- a/sys/compat/ibcs2/ibcs2_ipc.c +++ /dev/null @@ -1,459 +0,0 @@ -/* $OpenBSD: ibcs2_ipc.c,v 1.7 2002/03/14 01:26:50 millert Exp $ */ -/* $NetBSD: ibcs2_ipc.c,v 1.7 1997/01/18 01:51:41 mycroft Exp $ */ - -/* - * Copyright (c) 1995 Scott Bartram - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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/systm.h> -#include <sys/namei.h> -#include <sys/proc.h> -#include <sys/file.h> -#include <sys/stat.h> -#include <sys/filedesc.h> -#include <sys/ioctl.h> -#include <sys/ipc.h> -#include <sys/kernel.h> -#include <sys/malloc.h> -#include <sys/mbuf.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/reboot.h> -#include <sys/resource.h> -#include <sys/resourcevar.h> -#include <sys/signal.h> -#include <sys/signalvar.h> -#include <sys/socket.h> -#include <sys/time.h> -#include <sys/times.h> -#include <sys/vnode.h> -#include <sys/uio.h> -#include <sys/wait.h> -#include <sys/utsname.h> -#include <sys/unistd.h> -#include <sys/msg.h> -#include <sys/sem.h> -#include <sys/shm.h> -#include <sys/syscallargs.h> - -#include <uvm/uvm_extern.h> - -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_syscallargs.h> -#include <compat/ibcs2/ibcs2_util.h> - -#define IBCS2_IPC_RMID 0 -#define IBCS2_IPC_SET 1 -#define IBCS2_IPC_STAT 2 - -#ifdef SYSVMSG -/* - * iBCS2 msgsys call - */ - -struct ibcs2_msqid_ds { - struct ipc_perm msg_perm; - struct msg *msg_first; - struct msg *msg_last; - u_short msg_cbytes; - u_short msg_qnum; - u_short msg_qbytes; - u_short msg_lspid; - u_short msg_lrpid; - ibcs2_time_t msg_stime; - ibcs2_time_t msg_rtime; - ibcs2_time_t msg_ctime; -}; - -void cvt_msqid2imsqid(struct msqid_ds *, struct ibcs2_msqid_ds *); -void cvt_imsqid2msqid(struct ibcs2_msqid_ds *, struct msqid_ds *); - -void -cvt_msqid2imsqid(bp, ibp) - struct msqid_ds *bp; - struct ibcs2_msqid_ds *ibp; -{ - ibp->msg_perm = bp->msg_perm; - ibp->msg_first = bp->msg_first; - ibp->msg_last = bp->msg_last; - ibp->msg_cbytes = (u_short)bp->msg_cbytes; - ibp->msg_qnum = (u_short)bp->msg_qnum; - ibp->msg_qbytes = (u_short)bp->msg_qbytes; - ibp->msg_lspid = (u_short)bp->msg_lspid; - ibp->msg_lrpid = (u_short)bp->msg_lrpid; - ibp->msg_stime = bp->msg_stime; - ibp->msg_rtime = bp->msg_rtime; - ibp->msg_ctime = bp->msg_ctime; - return; -} - -void -cvt_imsqid2msqid(ibp, bp) - struct ibcs2_msqid_ds *ibp; - struct msqid_ds *bp; -{ - bp->msg_perm = ibp->msg_perm; - bp->msg_first = ibp->msg_first; - bp->msg_last = ibp->msg_last; - bp->msg_cbytes = ibp->msg_cbytes; - bp->msg_qnum = ibp->msg_qnum; - bp->msg_qbytes = ibp->msg_qbytes; - bp->msg_lspid = ibp->msg_lspid; - bp->msg_lrpid = ibp->msg_lrpid; - bp->msg_stime = ibp->msg_stime; - bp->msg_rtime = ibp->msg_rtime; - bp->msg_ctime = ibp->msg_ctime; - return; -} - -int -ibcs2_sys_msgsys(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_msgsys_args /* { - syscallarg(int) which; - syscallarg(int) a2; - syscallarg(int) a3; - syscallarg(int) a4; - syscallarg(int) a5; - syscallarg(int) a6; - } */ *uap = v; - - switch (SCARG(uap, which)) { - case 0: /* msgget */ - SCARG(uap, which) = 1; - return compat_10_sys_msgsys(p, uap, retval); - case 1: { /* msgctl */ - int error; - struct compat_10_sys_msgsys_args margs; - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(&margs, which) = 0; - SCARG(&margs, a2) = SCARG(uap, a2); - SCARG(&margs, a4) = - (int)stackgap_alloc(&sg, sizeof(struct msqid_ds)); - SCARG(&margs, a3) = SCARG(uap, a3); - switch (SCARG(&margs, a3)) { - case IBCS2_IPC_STAT: - error = compat_10_sys_msgsys(p, &margs, retval); - if (!error) - cvt_msqid2imsqid((struct msqid_ds *) - SCARG(&margs, a4), - (struct ibcs2_msqid_ds *)SCARG(uap, a4)); - return error; - case IBCS2_IPC_SET: - cvt_imsqid2msqid((struct ibcs2_msqid_ds *)SCARG(uap, - a4), - (struct msqid_ds *) SCARG(&margs, a4)); - return compat_10_sys_msgsys(p, &margs, retval); - case IBCS2_IPC_RMID: - return compat_10_sys_msgsys(p, &margs, retval); - } - return EINVAL; - } - case 2: /* msgrcv */ - SCARG(uap, which) = 3; - return compat_10_sys_msgsys(p, uap, retval); - case 3: /* msgsnd */ - SCARG(uap, which) = 2; - return compat_10_sys_msgsys(p, uap, retval); - default: - return EINVAL; - } -} -#endif - - -#ifdef SYSVSEM -/* - * iBCS2 semsys call - */ - -struct ibcs2_semid_ds { - struct ipc_perm sem_perm; - struct ibcs2_sem *sem_base; - u_short sem_nsems; - int pad1; - ibcs2_time_t sem_otime; - ibcs2_time_t sem_ctime; -}; - -struct ibcs2_sem { - u_short semval; - ibcs2_pid_t sempid; - u_short semncnt; - u_short semzcnt; -}; - -void cvt_semid2isemid(struct semid_ds *, struct ibcs2_semid_ds *); -void cvt_isemid2semid(struct ibcs2_semid_ds *, struct semid_ds *); -#ifdef notdef -void cvt_sem2isem(struct sem *, struct ibcs2_sem *); -void cvt_isem2sem(struct ibcs2_sem *, struct sem *); - -void -cvt_sem2isem(bp, ibp) - struct sem *bp; - struct ibcs2_sem *ibp; -{ - ibp->semval = bp->semval; - ibp->sempid = bp->sempid; - ibp->semncnt = bp->semncnt; - ibp->semzcnt = bp->semzcnt; - return; -} - -void -cvt_isem2sem(ibp, bp) - struct ibcs2_sem *ibp; - struct sem *bp; -{ - bp->semval = ibp->semval; - bp->sempid = ibp->sempid; - bp->semncnt = ibp->semncnt; - bp->semzcnt = ibp->semzcnt; - return; -} -#endif - -void -cvt_semid2isemid(bp, ibp) - struct semid_ds *bp; - struct ibcs2_semid_ds *ibp; -{ - ibp->sem_perm = bp->sem_perm; - ibp->sem_base = (struct ibcs2_sem *)bp->sem_base; - ibp->sem_nsems = bp->sem_nsems; - ibp->sem_otime = bp->sem_otime; - ibp->sem_ctime = bp->sem_ctime; - return; -} - -void -cvt_isemid2semid(ibp, bp) - struct ibcs2_semid_ds *ibp; - struct semid_ds *bp; -{ - bp->sem_perm = ibp->sem_perm; - bp->sem_base = (struct sem *)ibp->sem_base; - bp->sem_nsems = ibp->sem_nsems; - bp->sem_otime = ibp->sem_otime; - bp->sem_ctime = ibp->sem_ctime; - return; -} - -int -ibcs2_sys_semsys(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_semsys_args /* { - syscallarg(int) which; - syscallarg(int) a2; - syscallarg(int) a3; - syscallarg(int) a4; - syscallarg(int) a5; - } */ *uap = v; - int error; - - switch (SCARG(uap, which)) { - case 0: /* semctl */ - switch(SCARG(uap, a4)) { - case IBCS2_IPC_STAT: - { - struct ibcs2_semid_ds *isp; - struct semid_ds *sp; - caddr_t sg = stackgap_init(p->p_emul); - - isp = (struct ibcs2_semid_ds *)SCARG(uap, a5); - sp = stackgap_alloc(&sg, sizeof(struct semid_ds)); - SCARG(uap, a5) = (int)sp; - error = compat_10_sys_semsys(p, uap, retval); - if (!error) { - SCARG(uap, a5) = (int)isp; - isp = stackgap_alloc(&sg, sizeof(*isp)); - cvt_semid2isemid(sp, isp); - error = copyout((caddr_t)isp, - (caddr_t)SCARG(uap, a5), - sizeof(*isp)); - } - return error; - } - case IBCS2_IPC_SET: - { - struct ibcs2_semid_ds *isp; - struct semid_ds *sp; - caddr_t sg = stackgap_init(p->p_emul); - - isp = stackgap_alloc(&sg, sizeof(*isp)); - sp = stackgap_alloc(&sg, sizeof(*sp)); - error = copyin((caddr_t)SCARG(uap, a5), (caddr_t)isp, - sizeof(*isp)); - if (error) - return error; - cvt_isemid2semid(isp, sp); - SCARG(uap, a5) = (int)sp; - return compat_10_sys_semsys(p, uap, retval); - } - } - return compat_10_sys_semsys(p, uap, retval); - - case 1: /* semget */ - return compat_10_sys_semsys(p, uap, retval); - - case 2: /* semop */ - return compat_10_sys_semsys(p, uap, retval); - } - return EINVAL; -} -#endif - - -#ifdef SYSVSHM -/* - * iBCS2 shmsys call - */ - -struct ibcs2_shmid_ds { - struct ipc_perm shm_perm; - int shm_segsz; - int pad1; - char pad2[4]; - u_short shm_lpid; - u_short shm_cpid; - u_short shm_nattch; - u_short shm_cnattch; - ibcs2_time_t shm_atime; - ibcs2_time_t shm_dtime; - ibcs2_time_t shm_ctime; -}; - -void cvt_shmid2ishmid(struct shmid_ds *, struct ibcs2_shmid_ds *); -void cvt_ishmid2shmid(struct ibcs2_shmid_ds *, struct shmid_ds *); - -void -cvt_shmid2ishmid(bp, ibp) - struct shmid_ds *bp; - struct ibcs2_shmid_ds *ibp; -{ - ibp->shm_perm = bp->shm_perm; - ibp->shm_segsz = bp->shm_segsz; - ibp->shm_lpid = bp->shm_lpid; - ibp->shm_cpid = bp->shm_cpid; - ibp->shm_nattch = bp->shm_nattch; - ibp->shm_cnattch = 0; /* ignored anyway */ - ibp->shm_atime = bp->shm_atime; - ibp->shm_dtime = bp->shm_dtime; - ibp->shm_ctime = bp->shm_ctime; - return; -} - -void -cvt_ishmid2shmid(ibp, bp) - struct ibcs2_shmid_ds *ibp; - struct shmid_ds *bp; -{ - bp->shm_perm = ibp->shm_perm; - bp->shm_segsz = ibp->shm_segsz; - bp->shm_lpid = ibp->shm_lpid; - bp->shm_cpid = ibp->shm_cpid; - bp->shm_nattch = ibp->shm_nattch; - bp->shm_atime = ibp->shm_atime; - bp->shm_dtime = ibp->shm_dtime; - bp->shm_ctime = ibp->shm_ctime; - bp->shm_internal = (void *)0; /* ignored anyway */ - return; -} - -int -ibcs2_sys_shmsys(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_shmsys_args /* { - syscallarg(int) which; - syscallarg(int) a2; - syscallarg(int) a3; - syscallarg(int) a4; - } */ *uap = v; - int error; - - switch (SCARG(uap, which)) { - case 0: /* shmat */ - return compat_10_sys_shmsys(p, uap, retval); - - case 1: /* shmctl */ - switch(SCARG(uap, a3)) { - case IBCS2_IPC_STAT: - { - struct ibcs2_shmid_ds *isp; - struct shmid_ds *sp; - caddr_t sg = stackgap_init(p->p_emul); - - isp = (struct ibcs2_shmid_ds *)SCARG(uap, a4); - sp = stackgap_alloc(&sg, sizeof(*sp)); - SCARG(uap, a4) = (int)sp; - error = compat_10_sys_shmsys(p, uap, retval); - if (!error) { - SCARG(uap, a4) = (int)isp; - isp = stackgap_alloc(&sg, sizeof(*isp)); - cvt_shmid2ishmid(sp, isp); - error = copyout((caddr_t)isp, - (caddr_t)SCARG(uap, a4), - sizeof(*isp)); - } - return error; - } - case IBCS2_IPC_SET: - { - struct ibcs2_shmid_ds *isp; - struct shmid_ds *sp; - caddr_t sg = stackgap_init(p->p_emul); - - isp = stackgap_alloc(&sg, sizeof(*isp)); - sp = stackgap_alloc(&sg, sizeof(*sp)); - error = copyin((caddr_t)SCARG(uap, a4), (caddr_t)isp, - sizeof(*isp)); - if (error) - return error; - cvt_ishmid2shmid(isp, sp); - SCARG(uap, a4) = (int)sp; - return compat_10_sys_shmsys(p, uap, retval); - } - } - return compat_10_sys_shmsys(p, uap, retval); - - case 2: /* shmdt */ - return compat_10_sys_shmsys(p, uap, retval); - - case 3: /* shmget */ - return compat_10_sys_shmsys(p, uap, retval); - } - return EINVAL; -} -#endif diff --git a/sys/compat/ibcs2/ibcs2_misc.c b/sys/compat/ibcs2/ibcs2_misc.c deleted file mode 100644 index 6eae6b7b56a..00000000000 --- a/sys/compat/ibcs2/ibcs2_misc.c +++ /dev/null @@ -1,1367 +0,0 @@ -/* $OpenBSD: ibcs2_misc.c,v 1.30 2009/09/05 10:28:41 miod Exp $ */ -/* $NetBSD: ibcs2_misc.c,v 1.23 1997/01/15 01:37:49 perry Exp $ */ - -/* - * Copyright (c) 1994, 1995 Scott Bartram - * 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. - * - * from: Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp - * - * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 - */ - -/* - * IBCS2 compatibility module. - * - * IBCS2 system calls that are implemented differently in BSD are - * handled here. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/namei.h> -#include <sys/dirent.h> -#include <sys/proc.h> -#include <sys/file.h> -#include <sys/filedesc.h> -#include <sys/ioctl.h> -#include <sys/kernel.h> -#include <sys/malloc.h> -#include <sys/mbuf.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/reboot.h> -#include <sys/resource.h> -#include <sys/resourcevar.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/time.h> -#include <sys/times.h> -#include <sys/vnode.h> -#include <sys/uio.h> -#include <sys/wait.h> -#include <sys/utsname.h> -#include <sys/unistd.h> - -#include <netinet/in.h> -#include <sys/syscallargs.h> - -#include <miscfs/specfs/specdev.h> - -#include <uvm/uvm_extern.h> -#include <sys/sysctl.h> /* must be included after vm.h */ - -#include <i386/include/reg.h> - -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_dirent.h> -#include <compat/ibcs2/ibcs2_fcntl.h> -#include <compat/ibcs2/ibcs2_time.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_timeb.h> -#include <compat/ibcs2/ibcs2_unistd.h> -#include <compat/ibcs2/ibcs2_utsname.h> -#include <compat/ibcs2/ibcs2_util.h> -#include <compat/ibcs2/ibcs2_utime.h> -#include <compat/ibcs2/ibcs2_syscallargs.h> -#include <compat/ibcs2/ibcs2_sysi86.h> - -#include <compat/common/compat_dir.h> - -int -ibcs2_sys_ulimit(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_ulimit_args /* { - syscallarg(int) cmd; - syscallarg(int) newlimit; - } */ *uap = v; -#ifdef notyet - int error; - struct rlimit rl; - struct sys_setrlimit_args sra; -#endif -#define IBCS2_GETFSIZE 1 -#define IBCS2_SETFSIZE 2 -#define IBCS2_GETPSIZE 3 -#define IBCS2_GETDTABLESIZE 4 - - switch (SCARG(uap, cmd)) { - case IBCS2_GETFSIZE: - *retval = p->p_rlimit[RLIMIT_FSIZE].rlim_cur; - return 0; - case IBCS2_SETFSIZE: /* XXX - fix this */ -#ifdef notyet - rl.rlim_cur = SCARG(uap, newlimit); - SCARG(&sra, which) = RLIMIT_FSIZE; - SCARG(&sra, rlp) = &rl; - error = setrlimit(p, &sra, retval); - if (!error) - *retval = p->p_rlimit[RLIMIT_FSIZE].rlim_cur; - else - DPRINTF(("failed ")); - return error; -#else - *retval = SCARG(uap, newlimit); - return 0; -#endif - case IBCS2_GETPSIZE: - *retval = p->p_rlimit[RLIMIT_RSS].rlim_cur; /* XXX */ - return 0; - case IBCS2_GETDTABLESIZE: - SCARG(uap, cmd) = IBCS2_SC_OPEN_MAX; - return ibcs2_sys_sysconf(p, uap, retval); - default: - return ENOSYS; - } -} - -int -ibcs2_sys_waitsys(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_waitsys_args /* { - syscallarg(int) a1; - syscallarg(int) a2; - syscallarg(int) a3; - } */ *uap = v; - int error; - struct sys_wait4_args w4; -#define WAITPID_EFLAGS 0x8c4 /* OF, SF, ZF, PF */ - - SCARG(&w4, rusage) = NULL; - if ((p->p_md.md_regs->tf_eflags & WAITPID_EFLAGS) == WAITPID_EFLAGS) { - /* waitpid */ - SCARG(&w4, pid) = SCARG(uap, a1); - SCARG(&w4, status) = (int *)SCARG(uap, a2); - SCARG(&w4, options) = SCARG(uap, a3); - } else { - /* wait */ - SCARG(&w4, pid) = WAIT_ANY; - SCARG(&w4, status) = (int *)SCARG(uap, a1); - SCARG(&w4, options) = 0; - } - if ((error = sys_wait4(p, &w4, retval)) != 0) - return error; - if (SCARG(&w4, status)) /* this is real iBCS brain-damage */ - return copyin((caddr_t)SCARG(&w4, status), (caddr_t)&retval[1], - sizeof(SCARG(&w4, status))); - return 0; -} - -int -ibcs2_sys_execv(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_execv_args /* { - syscallarg(char *) path; - syscallarg(char **) argp; - } */ *uap = v; - struct sys_execve_args ap; - caddr_t sg; - - sg = stackgap_init(p->p_emul); - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - SCARG(&ap, path) = SCARG(uap, path); - SCARG(&ap, argp) = SCARG(uap, argp); - SCARG(&ap, envp) = NULL; - - return sys_execve(p, &ap, retval); -} - -int -ibcs2_sys_execve(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_execve_args /* { - syscallarg(char *) path; - syscallarg(char **) argv; - syscallarg(char **) envp; - } */ *uap = v; - struct sys_execve_args ap; - caddr_t sg; - - sg = stackgap_init(p->p_emul); - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - SCARG(&ap, path) = SCARG(uap, path); - SCARG(&ap, argp) = SCARG(uap, argp); - SCARG(&ap, envp) = SCARG(uap, envp); - - return sys_execve(p, &ap, retval); -} - -int -ibcs2_sys_umount(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_umount_args /* { - syscallarg(char *) name; - } */ *uap = v; - struct sys_unmount_args um; - - SCARG(&um, path) = SCARG(uap, name); - SCARG(&um, flags) = 0; - return sys_unmount(p, &um, retval); -} - -int -ibcs2_sys_mount(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ -#ifdef notyet - struct ibcs2_sys_mount_args /* { - syscallarg(char *) special; - syscallarg(char *) dir; - syscallarg(int) flags; - syscallarg(int) fstype; - syscallarg(char *) data; - syscallarg(int) len; - } */ *uap = v; - int oflags = SCARG(uap, flags), nflags, error; - char fsname[MFSNAMELEN]; - - if (oflags & (IBCS2_MS_NOSUB | IBCS2_MS_SYS5)) - return (EINVAL); - if ((oflags & IBCS2_MS_NEWTYPE) == 0) - return (EINVAL); - nflags = 0; - if (oflags & IBCS2_MS_RDONLY) - nflags |= MNT_RDONLY; - if (oflags & IBCS2_MS_NOSUID) - nflags |= MNT_NOSUID; - if (oflags & IBCS2_MS_REMOUNT) - nflags |= MNT_UPDATE; - SCARG(uap, flags) = nflags; - - if (error = copyinstr((caddr_t)SCARG(uap, type), fsname, sizeof fsname, - (u_int *)0)) - return (error); - - if (strncmp(fsname, "4.2", sizeof fsname) == 0) { - SCARG(uap, type) = (caddr_t)STACK_ALLOC(); - if (error = copyout("ffs", SCARG(uap, type), sizeof("ffs"))) - return (error); - } else if (strncmp(fsname, "nfs", sizeof fsname) == 0) { - struct ibcs2_nfs_args sna; - struct sockaddr_in sain; - struct nfs_args na; - struct sockaddr sa; - - if (error = copyin(SCARG(uap, data), &sna, sizeof sna)) - return (error); - if (error = copyin(sna.addr, &sain, sizeof sain)) - return (error); - bcopy(&sain, &sa, sizeof sa); - sa.sa_len = sizeof(sain); - SCARG(uap, data) = (caddr_t)STACK_ALLOC(); - na.addr = (struct sockaddr *)((int)SCARG(uap, data) + sizeof na); - na.sotype = SOCK_DGRAM; - na.proto = IPPROTO_UDP; - na.fh = (nfsv2fh_t *)sna.fh; - na.flags = sna.flags; - na.wsize = sna.wsize; - na.rsize = sna.rsize; - na.timeo = sna.timeo; - na.retrans = sna.retrans; - na.hostname = sna.hostname; - - if (error = copyout(&sa, na.addr, sizeof sa)) - return (error); - if (error = copyout(&na, SCARG(uap, data), sizeof na)) - return (error); - } - return (sys_mount(p, uap, retval)); -#else - return EINVAL; -#endif -} - -/* - * Read iBCS2-style directory entries. We suck them into kernel space so - * that they can be massaged before being copied out to user code. Like - * SunOS, we squish out `empty' entries. - * - * This is quite ugly, but what do you expect from compatibility code? - */ - -int ibcs2_readdir_callback(void *, struct dirent *, off_t); -int ibcs2_classicread_callback(void *, struct dirent *, off_t); - -struct ibcs2_readdir_callback_args { - caddr_t outp; - int resid; -}; - -int -ibcs2_readdir_callback(arg, bdp, cookie) - void *arg; - struct dirent *bdp; - off_t cookie; -{ - struct ibcs2_dirent idb; - struct ibcs2_readdir_callback_args *cb = arg; - int ibcs2_reclen; - int error; - - ibcs2_reclen = IBCS2_RECLEN(&idb, bdp->d_namlen); - if (cb->resid < ibcs2_reclen) - return (ENOMEM); - - /* - * Massage in place to make a iBCS2-shaped dirent (otherwise - * we have to worry about touching user memory outside of - * the copyout() call). - */ - idb.d_ino = (ibcs2_ino_t)bdp->d_fileno; - idb.d_pad = 0; - idb.d_off = (ibcs2_off_t)cookie; - idb.d_reclen = (u_short)ibcs2_reclen; - strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); - error = copyout((caddr_t)&idb, cb->outp, ibcs2_reclen); - if (error) - return (error); - - /* advance output past iBCS2-shaped entry */ - cb->outp += ibcs2_reclen; - cb->resid -= ibcs2_reclen; - - return (0); -} - -int -ibcs2_classicread_callback(arg, bdp, cookie) - void *arg; - struct dirent *bdp; - off_t cookie; -{ - struct ibcs2_direct { - ibcs2_ino_t ino; - char name[14]; - } idb; - struct ibcs2_readdir_callback_args *cb = arg; - int ibcs2_reclen; - int error; - - ibcs2_reclen = 16; - if (cb->resid < ibcs2_reclen) - return (ENOMEM); - - /* - * TODO: if length(filename) > 14 then break filename into - * multiple entries and set inode = 0xffff except last - */ - idb.ino = (bdp->d_fileno > 0xfffe) ? 0xfffe : bdp->d_fileno; - bzero(&idb.name, sizeof(idb.name)); - strncpy(idb.name, bdp->d_name, 14); - error = copyout(&idb, cb->outp, ibcs2_reclen); - if (error) - return (error); - - /* advance output past iBCS2-shaped entry */ - cb->outp += ibcs2_reclen; - cb->resid -= ibcs2_reclen; - - return (0); -} - -int -ibcs2_sys_getdents(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - register struct ibcs2_sys_getdents_args /* { - syscallarg(int) fd; - syscallarg(char *) buf; - syscallarg(int) nbytes; - } */ *uap = v; - struct ibcs2_readdir_callback_args args; - struct file *fp; - int error; - - if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) - return (error); - - args.resid = SCARG(uap, nbytes); - args.outp = (caddr_t)SCARG(uap, buf); - error = readdir_with_callback(fp, &fp->f_offset, args.resid, - ibcs2_readdir_callback, &args); - FRELE(fp); - if (error) - return (error); - - *retval = SCARG(uap, nbytes) - args.resid; - return (0); -} - -int -ibcs2_sys_read(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_read_args /* { - syscallarg(int) fd; - syscallarg(char *) buf; - syscallarg(u_int) nbytes; - } */ *uap = v; - struct vnode *vp; - struct ibcs2_readdir_callback_args args; - struct file *fp; - int error; - - if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) { - if (error == EINVAL) - return sys_read(p, uap, retval); - else - return error; - } - if ((fp->f_flag & FREAD) == 0) { - error = EBADF; - goto bad; - } - vp = (struct vnode *)fp->f_data; - if (vp->v_type != VDIR) { - FRELE(fp); - return sys_read(p, uap, retval); - } - - args.resid = SCARG(uap, nbytes); - args.outp = (caddr_t)SCARG(uap, buf); - - error = readdir_with_callback(fp, &fp->f_offset, args.resid, - ibcs2_classicread_callback, &args); -bad: - FRELE(fp); - if (error) - return (error); - - *retval = SCARG(uap, nbytes) - args.resid; - return (0); -} - -int -ibcs2_sys_mknod(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_mknod_args /* { - syscallarg(char *) path; - syscallarg(int) mode; - syscallarg(int) dev; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); - if (S_ISFIFO(SCARG(uap, mode))) { - struct sys_mkfifo_args ap; - SCARG(&ap, path) = SCARG(uap, path); - SCARG(&ap, mode) = SCARG(uap, mode); - return sys_mkfifo(p, uap, retval); - } else { - struct sys_mknod_args ap; - SCARG(&ap, path) = SCARG(uap, path); - SCARG(&ap, mode) = SCARG(uap, mode); - SCARG(&ap, dev) = SCARG(uap, dev); - return sys_mknod(p, &ap, retval); - } -} - -int -ibcs2_sys_getgroups(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_getgroups_args /* { - syscallarg(int) gidsetsize; - syscallarg(ibcs2_gid_t *) gidset; - } */ *uap = v; - int error, i; - ibcs2_gid_t *iset = NULL; - struct sys_getgroups_args sa; - gid_t *gp; - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(&sa, gidsetsize) = SCARG(uap, gidsetsize); - if (SCARG(uap, gidsetsize)) { - SCARG(&sa, gidset) = stackgap_alloc(&sg, NGROUPS_MAX * - sizeof(gid_t)); - iset = stackgap_alloc(&sg, SCARG(uap, gidsetsize) * - sizeof(ibcs2_gid_t)); - } - if ((error = sys_getgroups(p, &sa, retval)) != 0) - return error; - if (iset) { - for (i = 0, gp = SCARG(&sa, gidset); i < retval[0]; i++) - iset[i] = (ibcs2_gid_t)*gp++; - if (retval[0] && (error = copyout((caddr_t)iset, - (caddr_t)SCARG(uap, gidset), - sizeof(ibcs2_gid_t) * retval[0]))) - return error; - } - return 0; -} - -int -ibcs2_sys_setgroups(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_setgroups_args /* { - syscallarg(int) gidsetsize; - syscallarg(ibcs2_gid_t *) gidset; - } */ *uap = v; - int error, i; - ibcs2_gid_t *iset; - struct sys_setgroups_args sa; - gid_t *gp; - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(&sa, gidsetsize) = SCARG(uap, gidsetsize); - gp = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) * sizeof(gid_t)); - iset = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) * - sizeof(ibcs2_gid_t)); - if (SCARG(&sa, gidsetsize)) { - error = copyin((caddr_t)SCARG(uap, gidset), (caddr_t)iset, - sizeof(ibcs2_gid_t) * SCARG(uap, gidsetsize)); - if (error) - return error; - } - for (i = 0; i < SCARG(&sa, gidsetsize); i++) - gp[i]= (gid_t)iset[i]; - SCARG(&sa, gidset) = gp; - return sys_setgroups(p, &sa, retval); -} - -int -ibcs2_sys_setuid(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_setuid_args /* { - syscallarg(int) uid; - } */ *uap = v; - struct sys_setuid_args sa; - - SCARG(&sa, uid) = (uid_t)SCARG(uap, uid); - return sys_setuid(p, &sa, retval); -} - -int -ibcs2_sys_setgid(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_setgid_args /* { - syscallarg(int) gid; - } */ *uap = v; - struct sys_setgid_args sa; - - SCARG(&sa, gid) = (gid_t)SCARG(uap, gid); - return sys_setgid(p, &sa, retval); -} - -int -xenix_sys_ftime(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct xenix_sys_ftime_args /* { - syscallarg(struct xenix_timeb *) tp; - } */ *uap = v; - struct timeval tv; - extern struct timezone tz; - struct xenix_timeb itb; - - microtime(&tv); - itb.time = tv.tv_sec; - itb.millitm = (tv.tv_usec / 1000); - itb.timezone = tz.tz_minuteswest; - itb.dstflag = tz.tz_dsttime; - return copyout((caddr_t)&itb, (caddr_t)SCARG(uap, tp), - xenix_timeb_len); -} - -int -ibcs2_sys_time(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_time_args /* { - syscallarg(ibcs2_time_t *) tp; - } */ *uap = v; - struct timeval tv; - - microtime(&tv); - *retval = tv.tv_sec; - if (SCARG(uap, tp)) - return copyout((caddr_t)&tv.tv_sec, (caddr_t)SCARG(uap, tp), - sizeof(ibcs2_time_t)); - else - return 0; -} - -int -ibcs2_sys_pathconf(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_pathconf_args /* { - syscallarg(char *) path; - syscallarg(int) name; - } */ *uap = v; - SCARG(uap, name)++; /* iBCS2 _PC_* defines are offset by one */ - return sys_pathconf(p, uap, retval); -} - -int -ibcs2_sys_fpathconf(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_fpathconf_args /* { - syscallarg(int) fd; - syscallarg(int) name; - } */ *uap = v; - SCARG(uap, name)++; /* iBCS2 _PC_* defines are offset by one */ - return sys_fpathconf(p, uap, retval); -} - -int -ibcs2_sys_sysconf(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_sysconf_args /* { - syscallarg(int) name; - } */ *uap = v; - int mib[2], value, error; - size_t len; - struct sys___sysctl_args sa; - struct sys_getrlimit_args ga; - - switch(SCARG(uap, name)) { - case IBCS2_SC_ARG_MAX: - mib[1] = KERN_ARGMAX; - break; - - case IBCS2_SC_CHILD_MAX: - { - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(&ga, which) = RLIMIT_NPROC; - SCARG(&ga, rlp) = stackgap_alloc(&sg, sizeof(struct rlimit)); - if ((error = sys_getrlimit(p, &ga, retval)) != 0) - return error; - *retval = SCARG(&ga, rlp)->rlim_cur; - return 0; - } - - case IBCS2_SC_CLK_TCK: - *retval = hz; - return 0; - - case IBCS2_SC_NGROUPS_MAX: - mib[1] = KERN_NGROUPS; - break; - - case IBCS2_SC_OPEN_MAX: - { - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(&ga, which) = RLIMIT_NOFILE; - SCARG(&ga, rlp) = stackgap_alloc(&sg, sizeof(struct rlimit)); - if ((error = sys_getrlimit(p, &ga, retval)) != 0) - return error; - *retval = SCARG(&ga, rlp)->rlim_cur; - return 0; - } - - case IBCS2_SC_JOB_CONTROL: - mib[1] = KERN_JOB_CONTROL; - break; - - case IBCS2_SC_SAVED_IDS: - mib[1] = KERN_SAVED_IDS; - break; - - case IBCS2_SC_VERSION: - mib[1] = KERN_POSIX1; - break; - - case IBCS2_SC_PASS_MAX: - *retval = 128; /* XXX - should we create PASS_MAX ? */ - return 0; - - case IBCS2_SC_XOPEN_VERSION: - *retval = 2; /* XXX: What should that be? */ - return 0; - - default: - return EINVAL; - } - - mib[0] = CTL_KERN; - len = sizeof(value); - SCARG(&sa, name) = mib; - SCARG(&sa, namelen) = 2; - SCARG(&sa, old) = &value; - SCARG(&sa, oldlenp) = &len; - SCARG(&sa, new) = NULL; - SCARG(&sa, newlen) = 0; - if ((error = sys___sysctl(p, &sa, retval)) != 0) - return error; - *retval = value; - return 0; -} - -int -ibcs2_sys_alarm(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_alarm_args /* { - syscallarg(unsigned) sec; - } */ *uap = v; - int error; - struct itimerval *itp, *oitp; - struct sys_setitimer_args sa; - caddr_t sg = stackgap_init(p->p_emul); - - itp = stackgap_alloc(&sg, sizeof(*itp)); - oitp = stackgap_alloc(&sg, sizeof(*oitp)); - timerclear(&itp->it_interval); - itp->it_value.tv_sec = SCARG(uap, sec); - itp->it_value.tv_usec = 0; - - SCARG(&sa, which) = ITIMER_REAL; - SCARG(&sa, itv) = itp; - SCARG(&sa, oitv) = oitp; - error = sys_setitimer(p, &sa, retval); - if (error) - return error; - if (oitp->it_value.tv_usec) - oitp->it_value.tv_sec++; - *retval = oitp->it_value.tv_sec; - return 0; -} - -int -ibcs2_sys_getmsg(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ -#ifdef notyet - struct ibcs2_sys_getmsg_args /* { - syscallarg(int) fd; - syscallarg(struct ibcs2_stropts *) ctl; - syscallarg(struct ibcs2_stropts *) dat; - syscallarg(int *) flags; - } */ *uap = v; -#endif - - return 0; -} - -int -ibcs2_sys_putmsg(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ -#ifdef notyet - struct ibcs2_sys_putmsg_args /* { - syscallarg(int) fd; - syscallarg(struct ibcs2_stropts *) ctl; - syscallarg(struct ibcs2_stropts *) dat; - syscallarg(int) flags; - } */ *uap = v; -#endif - - return 0; -} - -int -ibcs2_sys_times(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_times_args /* { - syscallarg(struct tms *) tp; - } */ *uap = v; - int error; - struct sys_getrusage_args ga; - struct tms tms; - struct timeval t; - caddr_t sg = stackgap_init(p->p_emul); - struct rusage *ru = stackgap_alloc(&sg, sizeof(*ru)); -#define CONVTCK(r) (r.tv_sec * hz + r.tv_usec / (1000000 / hz)) - - SCARG(&ga, who) = RUSAGE_SELF; - SCARG(&ga, rusage) = ru; - error = sys_getrusage(p, &ga, retval); - if (error) - return error; - tms.tms_utime = CONVTCK(ru->ru_utime); - tms.tms_stime = CONVTCK(ru->ru_stime); - - SCARG(&ga, who) = RUSAGE_CHILDREN; - error = sys_getrusage(p, &ga, retval); - if (error) - return error; - tms.tms_cutime = CONVTCK(ru->ru_utime); - tms.tms_cstime = CONVTCK(ru->ru_stime); - - microtime(&t); - *retval = CONVTCK(t); - - return copyout((caddr_t)&tms, (caddr_t)SCARG(uap, tp), - sizeof(struct tms)); -} - -int -ibcs2_sys_stime(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_stime_args /* { - syscallarg(long *) timep; - } */ *uap = v; - int error; - struct sys_settimeofday_args sa; - caddr_t sg = stackgap_init(p->p_emul); - struct timeval *tvp; - - tvp = stackgap_alloc(&sg, sizeof(*SCARG(&sa, tv))); - SCARG(&sa, tzp) = NULL; - error = copyin((caddr_t)SCARG(uap, timep), (void *)&tvp->tv_sec, - sizeof(long)); - if (error) - return error; - tvp->tv_usec = 0; - SCARG(&sa, tv) = tvp; - if ((error = sys_settimeofday(p, &sa, retval)) != 0) - return EPERM; - return 0; -} - -int -ibcs2_sys_utime(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_utime_args /* { - syscallarg(char *) path; - syscallarg(struct ibcs2_utimbuf *) buf; - } */ *uap = v; - int error; - struct sys_utimes_args sa; - struct timeval *tp; - caddr_t sg = stackgap_init(p->p_emul); - - tp = stackgap_alloc(&sg, 2 * sizeof(struct timeval)); - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - SCARG(&sa, path) = SCARG(uap, path); - if (SCARG(uap, buf)) { - struct ibcs2_utimbuf ubuf; - - error = copyin((caddr_t)SCARG(uap, buf), (caddr_t)&ubuf, - sizeof(ubuf)); - if (error) - return error; - tp[0].tv_sec = ubuf.actime; - tp[0].tv_usec = 0; - tp[1].tv_sec = ubuf.modtime; - tp[1].tv_usec = 0; - SCARG(&sa, tptr) = tp; - } else - SCARG(&sa, tptr) = NULL; - return sys_utimes(p, &sa, retval); -} - -int -ibcs2_sys_nice(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_nice_args /* { - syscallarg(int) incr; - } */ *uap = v; - int error; - struct sys_setpriority_args sa; - - SCARG(&sa, which) = PRIO_PROCESS; - SCARG(&sa, who) = 0; - SCARG(&sa, prio) = p->p_nice - PZERO + SCARG(uap, incr); - if ((error = sys_setpriority(p, &sa, retval)) != 0) - return EPERM; - *retval = p->p_nice - PZERO; - return 0; -} - -/* - * iBCS2 getpgrp, setpgrp, setsid, and setpgid - */ - -int -ibcs2_sys_pgrpsys(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_pgrpsys_args /* { - syscallarg(int) type; - syscallarg(caddr_t) dummy; - syscallarg(int) pid; - syscallarg(int) pgid; - } */ *uap = v; - switch (SCARG(uap, type)) { - case 0: /* getpgrp */ - *retval = p->p_pgrp->pg_id; - return 0; - - case 1: /* setpgrp */ - { - struct sys_setpgid_args sa; - - SCARG(&sa, pid) = 0; - SCARG(&sa, pgid) = 0; - sys_setpgid(p, &sa, retval); - *retval = p->p_pgrp->pg_id; - return 0; - } - - case 2: /* setpgid */ - { - struct sys_setpgid_args sa; - - SCARG(&sa, pid) = SCARG(uap, pid); - SCARG(&sa, pgid) = SCARG(uap, pgid); - return sys_setpgid(p, &sa, retval); - } - - case 3: /* setsid */ - return sys_setsid(p, NULL, retval); - - default: - return EINVAL; - } -} - -/* - * XXX - need to check for nested calls - */ - -int -ibcs2_sys_plock(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_plock_args /* { - syscallarg(int) cmd; - } */ *uap = v; - int error; -#define IBCS2_UNLOCK 0 -#define IBCS2_PROCLOCK 1 -#define IBCS2_TEXTLOCK 2 -#define IBCS2_DATALOCK 4 - - - if ((error = suser(p, 0)) != 0) - return EPERM; - switch(SCARG(uap, cmd)) { - case IBCS2_UNLOCK: - case IBCS2_PROCLOCK: - case IBCS2_TEXTLOCK: - case IBCS2_DATALOCK: - return 0; /* XXX - TODO */ - } - return EINVAL; -} - -int -ibcs2_sys_uadmin(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_uadmin_args /* { - syscallarg(int) cmd; - syscallarg(int) func; - syscallarg(caddr_t) data; - } */ *uap = v; - int error; - -#define SCO_A_REBOOT 1 -#define SCO_A_SHUTDOWN 2 -#define SCO_A_REMOUNT 4 -#define SCO_A_CLOCK 8 -#define SCO_A_SETCONFIG 128 -#define SCO_A_GETDEV 130 - -#define SCO_AD_HALT 0 -#define SCO_AD_BOOT 1 -#define SCO_AD_IBOOT 2 -#define SCO_AD_PWRDOWN 3 -#define SCO_AD_PWRNAP 4 - -#define SCO_AD_PANICBOOT 1 - -#define SCO_AD_GETBMAJ 0 -#define SCO_AD_GETCMAJ 1 - - /* XXX: is this the right place for this call? */ - if ((error = suser(p, 0)) != 0) - return (error); - - switch(SCARG(uap, cmd)) { - case SCO_A_REBOOT: - case SCO_A_SHUTDOWN: - switch(SCARG(uap, func)) { - case SCO_AD_HALT: - case SCO_AD_PWRDOWN: - case SCO_AD_PWRNAP: - boot(RB_HALT); - case SCO_AD_BOOT: - case SCO_AD_IBOOT: - boot(RB_AUTOBOOT); - } - return EINVAL; - case SCO_A_REMOUNT: - case SCO_A_CLOCK: - case SCO_A_SETCONFIG: - return 0; - case SCO_A_GETDEV: - return EINVAL; /* XXX - TODO */ - } - return EINVAL; -} - -int -ibcs2_sys_sysfs(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_sysfs_args /* { - syscallarg(int) cmd; - syscallarg(caddr_t) d1; - syscallarg(char *) buf; - } */ *uap = v; - -#define IBCS2_GETFSIND 1 -#define IBCS2_GETFSTYP 2 -#define IBCS2_GETNFSTYP 3 - - switch(SCARG(uap, cmd)) { - case IBCS2_GETFSIND: - case IBCS2_GETFSTYP: - case IBCS2_GETNFSTYP: - break; - } - return EINVAL; /* XXX - TODO */ -} - -int -xenix_sys_rdchk(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct xenix_sys_rdchk_args /* { - syscallarg(int) fd; - } */ *uap = v; - int error; - struct sys_ioctl_args sa; - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(&sa, fd) = SCARG(uap, fd); - SCARG(&sa, com) = FIONREAD; - SCARG(&sa, data) = stackgap_alloc(&sg, sizeof(int)); - if ((error = sys_ioctl(p, &sa, retval)) != 0) - return error; - *retval = (*((int *)SCARG(&sa, data))) ? 1 : 0; - return 0; -} - -int -xenix_sys_chsize(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct xenix_sys_chsize_args /* { - syscallarg(int) fd; - syscallarg(long) size; - } */ *uap = v; - struct sys_ftruncate_args sa; - - SCARG(&sa, fd) = SCARG(uap, fd); - SCARG(&sa, pad) = 0; - SCARG(&sa, length) = SCARG(uap, size); - return sys_ftruncate(p, &sa, retval); -} - -int -xenix_sys_nap(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ -#ifdef notyet - struct xenix_sys_nap_args /* { - syscallarg(int) millisec; - } */ *uap = v; -#endif - - return ENOSYS; -} - -int -ibcs2_sys_unlink(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_unlink_args /* { - syscallarg(char *) path; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - return sys_unlink(p, uap, retval); -} - -int -ibcs2_sys_chdir(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_chdir_args /* { - syscallarg(char *) path; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - return sys_chdir(p, uap, retval); -} - -int -ibcs2_sys_chmod(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_chmod_args /* { - syscallarg(char *) path; - syscallarg(int) mode; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - return sys_chmod(p, uap, retval); -} - -int -ibcs2_sys_chown(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_chown_args /* { - syscallarg(char *) path; - syscallarg(int) uid; - syscallarg(int) gid; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - return sys_chown(p, uap, retval); -} - -int -ibcs2_sys_rmdir(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_rmdir_args /* { - syscallarg(char *) path; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - return sys_rmdir(p, uap, retval); -} - -int -ibcs2_sys_mkdir(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_mkdir_args /* { - syscallarg(char *) path; - syscallarg(int) mode; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); - return sys_mkdir(p, uap, retval); -} - -int -ibcs2_sys_symlink(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_symlink_args /* { - syscallarg(char *) path; - syscallarg(char *) link; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, link)); - return sys_symlink(p, uap, retval); -} - -int -ibcs2_sys_rename(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_rename_args /* { - syscallarg(char *) from; - syscallarg(char *) to; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, from)); - IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, to)); - return sys_rename(p, uap, retval); -} - -int -ibcs2_sys_readlink(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_readlink_args /* { - syscallarg(char *) path; - syscallarg(char *) buf; - syscallarg(int) count; - } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - return sys_readlink(p, uap, retval); -} - -int -ibcs2_sys_sysi86(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_sysi86_args /* { - syscallarg(int) cmd; - syscallarg(int) arg; - } */ *uap = v; - int val, error; - - switch (SCARG(uap, cmd)) { - case IBCS2_SI86FPHW: - val = IBCS2_FP_NO; -#ifdef MATH_EMULATE - val = IBCS2_FP_SW; -#else - val = IBCS2_FP_387; /* a real coprocessor */ -#endif - if ((error = copyout((caddr_t)&val, (caddr_t)SCARG(uap, arg), - sizeof(val)))) - return error; - break; - - case IBCS2_SI86STIME: /* XXX - not used much, if at all */ - case IBCS2_SI86SETNAME: - return EINVAL; - - case IBCS2_SI86PHYSMEM: - *retval = ptoa(physmem); - break; - - default: - return EINVAL; - } - return 0; -} diff --git a/sys/compat/ibcs2/ibcs2_mount.h b/sys/compat/ibcs2/ibcs2_mount.h deleted file mode 100644 index 6204242e4f7..00000000000 --- a/sys/compat/ibcs2/ibcs2_mount.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: ibcs2_mount.h,v 1.2 1996/08/02 20:35:08 niklas Exp $ */ -/* $NetBSD: ibcs2_mount.h,v 1.2 1994/10/26 02:53:00 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_MOUNT_H -#define _IBCS2_MOUNT_H - -#define IBCS2_MS_RDONLY 0x01 -#define IBCS2_MS_FSS 0x02 -#define IBCS2_MS_DATA 0x04 -#define IBCS2_MS_CACHE 0x08 - -#endif /* _IBCS2_MOUNT_H */ diff --git a/sys/compat/ibcs2/ibcs2_pwd.h b/sys/compat/ibcs2/ibcs2_pwd.h deleted file mode 100644 index d3b49af675a..00000000000 --- a/sys/compat/ibcs2/ibcs2_pwd.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $OpenBSD: ibcs2_pwd.h,v 1.2 1996/08/02 20:35:08 niklas Exp $ */ -/* $NetBSD: ibcs2_pwd.h,v 1.2 1994/10/26 02:53:01 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_PWD_H -#define _IBCS2_PWD_H - -struct ibcs2_passwd { - char *pw_name; - char *pw_passwd; - int pw_uid; - int pw_gid; - char *pw_age; - char *pw_comment; - char *pw_gecos; - char *pw_dir; - char *pw_shell; -}; - -#endif /* _IBCS2_PWD_H */ diff --git a/sys/compat/ibcs2/ibcs2_signal.c b/sys/compat/ibcs2/ibcs2_signal.c deleted file mode 100644 index bbd03a82423..00000000000 --- a/sys/compat/ibcs2/ibcs2_signal.c +++ /dev/null @@ -1,514 +0,0 @@ -/* $OpenBSD: ibcs2_signal.c,v 1.10 2009/12/09 16:29:56 jsg Exp $ */ -/* $NetBSD: ibcs2_signal.c,v 1.8 1996/05/03 17:05:27 christos Exp $ */ - -/* - * Copyright (c) 1995 Scott Bartram - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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/systm.h> -#include <sys/namei.h> -#include <sys/proc.h> -#include <sys/filedesc.h> -#include <sys/ioctl.h> -#include <sys/mount.h> -#include <sys/kernel.h> -#include <sys/signal.h> -#include <sys/signalvar.h> -#include <sys/malloc.h> - -#include <sys/syscallargs.h> - -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_syscallargs.h> -#include <compat/ibcs2/ibcs2_util.h> - -#define sigemptyset(s) bzero((s), sizeof(*(s))) -#define sigismember(s, n) (*(s) & sigmask(n)) -#define sigaddset(s, n) (*(s) |= sigmask(n)) - -#define ibcs2_sigmask(n) (1 << ((n) - 1)) -#define ibcs2_sigemptyset(s) bzero((s), sizeof(*(s))) -#define ibcs2_sigismember(s, n) (*(s) & ibcs2_sigmask(n)) -#define ibcs2_sigaddset(s, n) (*(s) |= ibcs2_sigmask(n)) - -int bsd_to_ibcs2_sig[NSIG] = { - 0, /* 0 */ - IBCS2_SIGHUP, /* 1 */ - IBCS2_SIGINT, /* 2 */ - IBCS2_SIGQUIT, /* 3 */ - IBCS2_SIGILL, /* 4 */ - IBCS2_SIGTRAP, /* 5 */ - IBCS2_SIGABRT, /* 6 */ - IBCS2_SIGEMT, /* 7 */ - IBCS2_SIGFPE, /* 8 */ - IBCS2_SIGKILL, /* 9 */ - IBCS2_SIGBUS, /* 10 */ - IBCS2_SIGSEGV, /* 11 */ - IBCS2_SIGSYS, /* 12 */ - IBCS2_SIGPIPE, /* 13 */ - IBCS2_SIGALRM, /* 14 */ - IBCS2_SIGTERM, /* 15 */ - 0, /* 16 - SIGURG */ - IBCS2_SIGSTOP, /* 17 */ - IBCS2_SIGTSTP, /* 18 */ - IBCS2_SIGCONT, /* 19 */ - IBCS2_SIGCLD, /* 20 */ - IBCS2_SIGTTIN, /* 21 */ - IBCS2_SIGTTOU, /* 22 */ - IBCS2_SIGPOLL, /* 23 */ - 0, /* 24 - SIGXCPU */ - 0, /* 25 - SIGXFSZ */ - IBCS2_SIGVTALRM, /* 26 */ - IBCS2_SIGPROF, /* 27 */ - IBCS2_SIGWINCH, /* 28 */ - 0, /* 29 */ - IBCS2_SIGUSR1, /* 30 */ - IBCS2_SIGUSR2, /* 31 */ - 0, /* 32 - SIGTHR */ -}; - -int ibcs2_to_bsd_sig[] = { - 0, /* 0 */ - SIGHUP, /* 1 */ - SIGINT, /* 2 */ - SIGQUIT, /* 3 */ - SIGILL, /* 4 */ - SIGTRAP, /* 5 */ - SIGABRT, /* 6 */ - SIGEMT, /* 7 */ - SIGFPE, /* 8 */ - SIGKILL, /* 9 */ - SIGBUS, /* 10 */ - SIGSEGV, /* 11 */ - SIGSYS, /* 12 */ - SIGPIPE, /* 13 */ - SIGALRM, /* 14 */ - SIGTERM, /* 15 */ - SIGUSR1, /* 16 */ - SIGUSR2, /* 17 */ - SIGCHLD, /* 18 */ - 0, /* 19 - SIGPWR */ - SIGWINCH, /* 20 */ - 0, /* 21 */ - SIGIO, /* 22 */ - SIGSTOP, /* 23 */ - SIGTSTP, /* 24 */ - SIGCONT, /* 25 */ - SIGTTIN, /* 26 */ - SIGTTOU, /* 27 */ - SIGVTALRM, /* 28 */ - SIGPROF, /* 29 */ - 0, /* 30 */ - 0, /* 31 */ -}; - -void ibcs2_to_bsd_sigset(const ibcs2_sigset_t *, sigset_t *); -void bsd_to_ibcs2_sigset(const sigset_t *, ibcs2_sigset_t *); -void ibcs2_to_bsd_sigaction(struct ibcs2_sigaction *, - struct sigaction *); -void bsd_to_ibcs2_sigaction(struct sigaction *, struct ibcs2_sigaction *); - -void -ibcs2_to_bsd_sigset(iss, bss) - const ibcs2_sigset_t *iss; - sigset_t *bss; -{ - int i, newsig; - - sigemptyset(bss); - for (i = 1; i < IBCS2_NSIG; i++) { - if (ibcs2_sigismember(iss, i)) { - newsig = ibcs2_to_bsd_sig[i]; - if (newsig) - sigaddset(bss, newsig); - } - } -} - -void -bsd_to_ibcs2_sigset(bss, iss) - const sigset_t *bss; - ibcs2_sigset_t *iss; -{ - int i, newsig; - - ibcs2_sigemptyset(iss); - for (i = 1; i < NSIG; i++) { - if (sigismember(bss, i)) { - newsig = bsd_to_ibcs2_sig[i]; - if (newsig) - ibcs2_sigaddset(iss, newsig); - } - } -} - -void -ibcs2_to_bsd_sigaction(isa, bsa) - struct ibcs2_sigaction *isa; - struct sigaction *bsa; -{ - - bsa->sa_handler = isa->sa__handler; - ibcs2_to_bsd_sigset(&isa->sa_mask, &bsa->sa_mask); - bsa->sa_flags = 0; - if ((isa->sa_flags & IBCS2_SA_NOCLDSTOP) != 0) - bsa->sa_flags |= SA_NOCLDSTOP; -} - -void -bsd_to_ibcs2_sigaction(bsa, isa) - struct sigaction *bsa; - struct ibcs2_sigaction *isa; -{ - - isa->sa__handler = bsa->sa_handler; - bsd_to_ibcs2_sigset(&bsa->sa_mask, &isa->sa_mask); - isa->sa_flags = 0; - if ((bsa->sa_flags & SA_NOCLDSTOP) != 0) - isa->sa_flags |= IBCS2_SA_NOCLDSTOP; -} - -int -ibcs2_sys_sigaction(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_sigaction_args /* { - syscallarg(int) signum; - syscallarg(struct ibcs2_sigaction *) nsa; - syscallarg(struct ibcs2_sigaction *) osa; - } */ *uap = v; - struct ibcs2_sigaction *nisa, *oisa, tmpisa; - struct sigaction *nbsa, *obsa, tmpbsa; - struct sys_sigaction_args sa; - caddr_t sg; - int error; - - if (SCARG(uap, signum) < 0 || SCARG(uap, signum) >= IBCS2_NSIG) - return (EINVAL); - - sg = stackgap_init(p->p_emul); - nisa = SCARG(uap, nsa); - oisa = SCARG(uap, osa); - - if (oisa != NULL) - obsa = stackgap_alloc(&sg, sizeof(struct sigaction)); - else - obsa = NULL; - - if (nisa != NULL) { - nbsa = stackgap_alloc(&sg, sizeof(struct sigaction)); - if ((error = copyin(nisa, &tmpisa, sizeof(tmpisa))) != 0) - return error; - ibcs2_to_bsd_sigaction(&tmpisa, &tmpbsa); - if ((error = copyout(&tmpbsa, nbsa, sizeof(tmpbsa))) != 0) - return error; - } else - nbsa = NULL; - - SCARG(&sa, signum) = ibcs2_to_bsd_sig[SCARG(uap, signum)]; - SCARG(&sa, nsa) = nbsa; - SCARG(&sa, osa) = obsa; - - if ((error = sys_sigaction(p, &sa, retval)) != 0) - return error; - - if (oisa != NULL) { - if ((error = copyin(obsa, &tmpbsa, sizeof(tmpbsa))) != 0) - return error; - bsd_to_ibcs2_sigaction(&tmpbsa, &tmpisa); - if ((error = copyout(&tmpisa, oisa, sizeof(tmpisa))) != 0) - return error; - } - - return 0; -} - -int -ibcs2_sys_sigsys(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_sigsys_args /* { - syscallarg(int) sig; - syscallarg(ibcs2_sig_t) fp; - } */ *uap = v; - int signum, error; - caddr_t sg = stackgap_init(p->p_emul); - - signum = IBCS2_SIGNO(SCARG(uap, sig)); - if (signum < 0 || signum >= IBCS2_NSIG) { - if (IBCS2_SIGCALL(SCARG(uap, sig)) == IBCS2_SIGNAL_MASK || - IBCS2_SIGCALL(SCARG(uap, sig)) == IBCS2_SIGSET_MASK) - *retval = (int)IBCS2_SIG_ERR; - return EINVAL; - } - signum = ibcs2_to_bsd_sig[signum]; - - switch (IBCS2_SIGCALL(SCARG(uap, sig))) { - /* - * sigset is identical to signal() except that SIG_HOLD is allowed as - * an action. - */ - case IBCS2_SIGSET_MASK: - /* - * sigset is identical to signal() except - * that SIG_HOLD is allowed as - * an action. - */ - if (SCARG(uap, fp) == IBCS2_SIG_HOLD) { - struct sys_sigprocmask_args sa; - - SCARG(&sa, how) = SIG_BLOCK; - SCARG(&sa, mask) = sigmask(signum); - return sys_sigprocmask(p, &sa, retval); - } - /* FALLTHROUGH */ - - case IBCS2_SIGNAL_MASK: - { - struct sys_sigaction_args sa_args; - struct sigaction *nbsa, *obsa, sa; - - nbsa = stackgap_alloc(&sg, sizeof(struct sigaction)); - obsa = stackgap_alloc(&sg, sizeof(struct sigaction)); - SCARG(&sa_args, signum) = signum; - SCARG(&sa_args, nsa) = nbsa; - SCARG(&sa_args, osa) = obsa; - - sa.sa_handler = SCARG(uap, fp); - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; -#if 0 - if (signum != SIGALRM) - sa.sa_flags = SA_RESTART; -#endif - if ((error = copyout(&sa, nbsa, sizeof(sa))) != 0) - return error; - if ((error = sys_sigaction(p, &sa_args, retval)) != 0) { - DPRINTF(("signal: sigaction failed: %d\n", - error)); - *retval = (int)IBCS2_SIG_ERR; - return error; - } - if ((error = copyin(obsa, &sa, sizeof(sa))) != 0) - return error; - *retval = (int)sa.sa_handler; - return 0; - } - - case IBCS2_SIGHOLD_MASK: - { - struct sys_sigprocmask_args sa; - - SCARG(&sa, how) = SIG_BLOCK; - SCARG(&sa, mask) = sigmask(signum); - return sys_sigprocmask(p, &sa, retval); - } - - case IBCS2_SIGRELSE_MASK: - { - struct sys_sigprocmask_args sa; - - SCARG(&sa, how) = SIG_UNBLOCK; - SCARG(&sa, mask) = sigmask(signum); - return sys_sigprocmask(p, &sa, retval); - } - - case IBCS2_SIGIGNORE_MASK: - { - struct sys_sigaction_args sa_args; - struct sigaction *bsa, sa; - - bsa = stackgap_alloc(&sg, sizeof(struct sigaction)); - SCARG(&sa_args, signum) = signum; - SCARG(&sa_args, nsa) = bsa; - SCARG(&sa_args, osa) = NULL; - - sa.sa_handler = SIG_IGN; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - if ((error = copyout(&sa, bsa, sizeof(sa))) != 0) - return error; - if ((error = sys_sigaction(p, &sa_args, retval)) != 0) { - DPRINTF(("sigignore: sigaction failed\n")); - return error; - } - return 0; - } - - case IBCS2_SIGPAUSE_MASK: - { - struct sys_sigsuspend_args sa; - - SCARG(&sa, mask) = p->p_sigmask &~ sigmask(signum); - return sys_sigsuspend(p, &sa, retval); - } - - default: - return ENOSYS; - } -} - -int -ibcs2_sys_sigprocmask(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_sigprocmask_args /* { - syscallarg(int) how; - syscallarg(ibcs2_sigset_t *) set; - syscallarg(ibcs2_sigset_t *) oset; - } */ *uap = v; - ibcs2_sigset_t iss; - sigset_t bss; - int error = 0; - int s; - - if (SCARG(uap, oset) != NULL) { - /* Fix the return value first if needed */ - bsd_to_ibcs2_sigset(&p->p_sigmask, &iss); - if ((error = copyout(&iss, SCARG(uap, oset), sizeof(iss))) != 0) - return error; - } - - if (SCARG(uap, set) == NULL) - /* Just examine */ - return 0; - - if ((error = copyin(SCARG(uap, set), &iss, sizeof(iss))) != 0) - return error; - - ibcs2_to_bsd_sigset(&iss, &bss); - - s = splhigh(); - - switch (SCARG(uap, how)) { - case IBCS2_SIG_BLOCK: - p->p_sigmask |= bss & ~sigcantmask; - break; - - case IBCS2_SIG_UNBLOCK: - p->p_sigmask &= ~bss; - break; - - case IBCS2_SIG_SETMASK: - p->p_sigmask = bss & ~sigcantmask; - break; - - default: - error = EINVAL; - break; - } - - splx(s); - - return error; -} - -int -ibcs2_sys_sigpending(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_sigpending_args /* { - syscallarg(ibcs2_sigset_t *) mask; - } */ *uap = v; - sigset_t bss; - ibcs2_sigset_t iss; - - bss = p->p_siglist & p->p_sigmask; - bsd_to_ibcs2_sigset(&bss, &iss); - - return copyout(&iss, SCARG(uap, mask), sizeof(iss)); -} - -int -ibcs2_sys_sigsuspend(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_sigsuspend_args /* { - syscallarg(ibcs2_sigset_t *) mask; - } */ *uap = v; - ibcs2_sigset_t sss; - sigset_t bss; - struct sys_sigsuspend_args sa; - int error; - - if ((error = copyin(SCARG(uap, mask), &sss, sizeof(sss))) != 0) - return error; - - ibcs2_to_bsd_sigset(&sss, &bss); - - SCARG(&sa, mask) = bss; - return sys_sigsuspend(p, &sa, retval); -} - -int -ibcs2_sys_pause(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - struct sys_sigsuspend_args bsa; - - SCARG(&bsa, mask) = p->p_sigmask; - return sys_sigsuspend(p, &bsa, retval); -} - -int -ibcs2_sys_kill(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_kill_args /* { - syscallarg(int) pid; - syscallarg(int) signo; - } */ *uap = v; - struct sys_kill_args ka; - - if (SCARG(uap, signo) < 0 || SCARG(uap, signo) >= IBCS2_NSIG) - return (EINVAL); - SCARG(&ka, pid) = SCARG(uap, pid); - SCARG(&ka, signum) = ibcs2_to_bsd_sig[SCARG(uap, signo)]; - return sys_kill(p, &ka, retval); -} - -void -ibcs2_sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) -{ - sendsig(catcher, bsd_to_ibcs2_sig[sig], mask, code, type, val); -} diff --git a/sys/compat/ibcs2/ibcs2_signal.h b/sys/compat/ibcs2/ibcs2_signal.h deleted file mode 100644 index 6b417d87990..00000000000 --- a/sys/compat/ibcs2/ibcs2_signal.h +++ /dev/null @@ -1,106 +0,0 @@ -/* $OpenBSD: ibcs2_signal.h,v 1.6 2009/06/01 20:11:38 weingart Exp $ */ -/* $NetBSD: ibcs2_signal.h,v 1.8 1996/05/03 17:05:28 christos Exp $ */ - -/* - * Copyright (c) 1994, 1995 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_SIGNAL_H -#define _IBCS2_SIGNAL_H - -#define IBCS2_SIGHUP 1 -#define IBCS2_SIGINT 2 -#define IBCS2_SIGQUIT 3 -#define IBCS2_SIGILL 4 -#define IBCS2_SIGTRAP 5 -#define IBCS2_SIGIOT 6 -#define IBCS2_SIGABRT 6 -#define IBCS2_SIGEMT 7 -#define IBCS2_SIGFPE 8 -#define IBCS2_SIGKILL 9 -#define IBCS2_SIGBUS 10 -#define IBCS2_SIGSEGV 11 -#define IBCS2_SIGSYS 12 -#define IBCS2_SIGPIPE 13 -#define IBCS2_SIGALRM 14 -#define IBCS2_SIGTERM 15 -#define IBCS2_SIGUSR1 16 -#define IBCS2_SIGUSR2 17 -#define IBCS2_SIGCLD 18 -#define IBCS2_SIGPWR 19 -#define IBCS2_SIGWINCH 20 -#define IBCS2_SIGPOLL 22 -#define IBCS2_NSIG 32 - -/* - * SCO-specific - */ -#define IBCS2_SIGSTOP 23 -#define IBCS2_SIGTSTP 24 -#define IBCS2_SIGCONT 25 -#define IBCS2_SIGTTIN 26 -#define IBCS2_SIGTTOU 27 -#define IBCS2_SIGVTALRM 28 -#define IBCS2_SIGPROF 29 - -#define IBCS2_SIGNO_MASK 0x00FF -#define IBCS2_SIGNAL_MASK 0x0000 -#define IBCS2_SIGSET_MASK 0x0100 -#define IBCS2_SIGHOLD_MASK 0x0200 -#define IBCS2_SIGRELSE_MASK 0x0400 -#define IBCS2_SIGIGNORE_MASK 0x0800 -#define IBCS2_SIGPAUSE_MASK 0x1000 - -#define IBCS2_SIGNO(x) ((x) & IBCS2_SIGNO_MASK) -#define IBCS2_SIGCALL(x) ((x) & ~IBCS2_SIGNO_MASK) - -#define IBCS2_SIG_DFL (void(*)(int)) 0 -#define IBCS2_SIG_ERR (void(*)(int)) -1 -#define IBCS2_SIG_IGN (void(*)(int)) 1 -#define IBCS2_SIG_HOLD (void(*)(int)) 2 - -#define IBCS2_SIG_SETMASK 0 -#define IBCS2_SIG_BLOCK 1 -#define IBCS2_SIG_UNBLOCK 2 - -typedef long ibcs2_sigset_t; -typedef void (*ibcs2_sig_t)(int); - -struct ibcs2_sigaction { - ibcs2_sig_t sa__handler; - ibcs2_sigset_t sa_mask; - int sa_flags; -}; - -/* sa_flags */ -#define IBCS2_SA_NOCLDSTOP 1 - -void ibcs2_sendsig(sig_t, int, int, u_long, int, union sigval); - -#endif /* _IBCS2_SIGNAL_H */ diff --git a/sys/compat/ibcs2/ibcs2_socksys.c b/sys/compat/ibcs2/ibcs2_socksys.c deleted file mode 100644 index ac03f84a4b9..00000000000 --- a/sys/compat/ibcs2/ibcs2_socksys.c +++ /dev/null @@ -1,137 +0,0 @@ -/* $OpenBSD: ibcs2_socksys.c,v 1.7 2003/01/30 03:29:49 millert Exp $ */ -/* $NetBSD: ibcs2_socksys.c,v 1.7 1996/10/13 00:46:51 christos Exp $ */ - -/* - * Copyright (c) 1994, 1995 Scott Bartram - * Copyright (c) 1994 Arne H Juul - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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/systm.h> -#include <sys/proc.h> -#include <sys/file.h> -#include <sys/filedesc.h> -#include <sys/ioctl.h> -#include <sys/termios.h> -#include <sys/tty.h> -#include <sys/socket.h> -#include <sys/mount.h> -#include <net/if.h> - -#include <sys/syscallargs.h> - -#include <compat/ibcs2/ibcs2_socksys.h> -#include <compat/ibcs2/ibcs2_util.h> - -/* - * iBCS2 socksys calls. - */ - -struct ibcs2_socksys_args { - int fd; - int magic; - caddr_t argsp; -}; - -int -ibcs2_socksys(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - register struct ibcs2_socksys_args *uap = v; - int error; - int realargs[7]; /* 1 for command, 6 for recvfrom */ - - /* - * SOCKET should only be legal on /dev/socksys. - * GETIPDOMAINNAME should only be legal on /dev/socksys ? - * The others are (and should be) only legal on sockets. - */ - - error = copyin(uap->argsp, (caddr_t)realargs, sizeof(realargs)); - if (error) - return error; - DPRINTF(("ibcs2_socksys: %08x %08x %08x %08x %08x %08x %08x\n", - realargs[0], realargs[1], realargs[2], realargs[3], - realargs[4], realargs[5], realargs[6])); - switch (realargs[0]) { - case SOCKSYS_ACCEPT: - return sys_accept(p, realargs + 1, retval); - case SOCKSYS_BIND: - return sys_bind(p, realargs + 1, retval); - case SOCKSYS_CONNECT: - return sys_connect(p, realargs + 1, retval); - case SOCKSYS_GETPEERNAME: - return sys_getpeername(p, realargs + 1, retval); - case SOCKSYS_GETSOCKNAME: - return sys_getsockname(p, realargs + 1, retval); - case SOCKSYS_GETSOCKOPT: - return sys_getsockopt(p, realargs + 1, retval); - case SOCKSYS_LISTEN: - return sys_listen(p, realargs + 1, retval); - case SOCKSYS_RECV: - realargs[5] = realargs[6] = 0; - /* FALLTHROUGH */ - case SOCKSYS_RECVFROM: - return sys_recvfrom(p, realargs + 1, retval); - case SOCKSYS_SEND: - realargs[5] = realargs[6] = 0; - /* FALLTHROUGH */ - case SOCKSYS_SENDTO: - return sys_sendto(p, realargs + 1, retval); - case SOCKSYS_SETSOCKOPT: - return sys_setsockopt(p, realargs + 1, retval); - case SOCKSYS_SHUTDOWN: - return sys_shutdown(p, realargs + 1, retval); - case SOCKSYS_SOCKET: - return sys_socket(p, realargs + 1, retval); - case SOCKSYS_SELECT: - return sys_select(p, realargs + 1, retval); - case SOCKSYS_GETIPDOMAIN: - return compat_09_sys_getdomainname(p, realargs + 1, retval); - case SOCKSYS_SETIPDOMAIN: - return compat_09_sys_setdomainname(p, realargs + 1, retval); - case SOCKSYS_ADJTIME: - return sys_adjtime(p, realargs + 1, retval); - case SOCKSYS_SETREUID: - return sys_setreuid(p, realargs + 1, retval); - case SOCKSYS_SETREGID: - return sys_setregid(p, realargs + 1, retval); - case SOCKSYS_GETTIME: - return sys_gettimeofday(p, realargs + 1, retval); - case SOCKSYS_SETTIME: - return sys_settimeofday(p, realargs + 1, retval); - case SOCKSYS_GETITIMER: - return sys_getitimer(p, realargs + 1, retval); - case SOCKSYS_SETITIMER: - return sys_setitimer(p, realargs + 1, retval); - - default: - printf("socksys unknown %08x %08x %08x %08x %08x %08x %08x\n", - realargs[0], realargs[1], realargs[2], realargs[3], - realargs[4], realargs[5], realargs[6]); - return EINVAL; - } - /* NOTREACHED */ -} diff --git a/sys/compat/ibcs2/ibcs2_socksys.h b/sys/compat/ibcs2/ibcs2_socksys.h deleted file mode 100644 index 281c8b8a4d0..00000000000 --- a/sys/compat/ibcs2/ibcs2_socksys.h +++ /dev/null @@ -1,123 +0,0 @@ -/* $OpenBSD: ibcs2_socksys.h,v 1.4 2002/03/14 01:26:50 millert Exp $ */ -/* $NetBSD: ibcs2_socksys.h,v 1.2 1996/05/03 17:05:30 christos Exp $ */ - -/* - * Copyright (c) 1994, 1995 Scott Bartram - * Copyright (c) 1994 Arne H Juul - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - - -#ifndef _IBCS2_SOCKSYS_H -#define _IBCS2_SOCKSYS_H 1 - -#include <sys/ioccom.h> -#include <compat/ibcs2/ibcs2_types.h> - -#define SOCKSYS_ACCEPT 1 -#define SOCKSYS_BIND 2 -#define SOCKSYS_CONNECT 3 -#define SOCKSYS_GETPEERNAME 4 -#define SOCKSYS_GETSOCKNAME 5 -#define SOCKSYS_GETSOCKOPT 6 -#define SOCKSYS_LISTEN 7 -#define SOCKSYS_RECV 8 -#define SOCKSYS_RECVFROM 9 -#define SOCKSYS_SEND 10 -#define SOCKSYS_SENDTO 11 -#define SOCKSYS_SETSOCKOPT 12 -#define SOCKSYS_SHUTDOWN 13 -#define SOCKSYS_SOCKET 14 -#define SOCKSYS_SELECT 15 -#define SOCKSYS_GETIPDOMAIN 16 -#define SOCKSYS_SETIPDOMAIN 17 -#define SOCKSYS_ADJTIME 18 -#define SOCKSYS_SETREUID 19 -#define SOCKSYS_SETREGID 20 -#define SOCKSYS_GETTIME 21 -#define SOCKSYS_SETTIME 22 -#define SOCKSYS_GETITIMER 23 -#define SOCKSYS_SETITIMER 24 - -#define IBCS2_SIOCSHIWAT _IOW('S', 1, int) -#define IBCS2_SIOCGHIWAT _IOR('S', 2, int) -#define IBCS2_SIOCSLOWAT _IOW('S', 3, int) -#define IBCS2_SIOCGLOWAT _IOR('S', 4, int) -#define IBCS2_SIOCATMARK _IOR('S', 5, int) -#define IBCS2_SIOCSPGRP _IOW('S', 6, int) -#define IBCS2_SIOCGPGRP _IOR('S', 7, int) -#define IBCS2_FIONREAD _IOR('S', 8, int) -#define IBCS2_FIONBIO _IOW('S', 9, int) -#define IBCS2_FIOASYNC _IOW('S', 10, int) -#define IBCS2_SIOCPROTO _IOW('S', 11, struct socknewproto) -#define IBCS2_SIOCGETNAME _IOR('S', 12, struct sockaddr) -#define IBCS2_SIOCGETPEER _IOR('S', 13, struct sockaddr) -#define IBCS2_IF_UNITSEL _IOW('S', 14, int) -#define IBCS2_SIOCXPROTO _IO('S', 15) - -#define IBCS2_SIOCADDRT _IOW('R', 9, struct rtentry) -#define IBCS2_SIOCDELRT _IOW('R', 10, struct rtentry) - -#define IBCS2_SIOCSIFADDR _IOW('I', 11, struct ifreq) -#define IBCS2_SIOCGIFADDR _IOWR('I', 12, struct ifreq) -#define IBCS2_SIOCSIFDSTADDR _IOW('I', 13, struct ifreq) -#define IBCS2_SIOCGIFDSTADDR _IOWR('I', 14, struct ifreq) -#define IBCS2_SIOCSIFFLAGS _IOW('I', 15, struct ifreq) -#define IBCS2_SIOCGIFFLAGS _IOWR('I', 16, struct ifreq) -#define IBCS2_SIOCGIFCONF _IOWR('I', 17, struct ifconf) -#define IBCS2_SIOCSIFMTU _IOW('I', 21, struct ifreq) -#define IBCS2_SIOCGIFMTU _IOWR('I', 22, struct ifreq) -#define IBCS2_SIOCIFDETACH _IOW('I', 26, struct ifreq) -#define IBCS2_SIOCGENPSTATS _IOWR('I', 27, struct ifreq) -#define IBCS2_SIOCX25XMT _IOWR('I', 29, struct ifreq) -#define IBCS2_SIOCX25RCV _IOWR('I', 30, struct ifreq) -#define IBCS2_SIOCX25TBL _IOWR('I', 31, struct ifreq) -#define IBCS2_SIOCGIFBRDADDR _IOWR('I', 32, struct ifreq) -#define IBCS2_SIOCSIFBRDADDR _IOW('I', 33, struct ifreq) -#define IBCS2_SIOCGIFNETMASK _IOWR('I', 34, struct ifreq) -#define IBCS2_SIOCSIFNETMASK _IOW('I', 35, struct ifreq) -#define IBCS2_SIOCGIFMETRIC _IOWR('I', 36, struct ifreq) -#define IBCS2_SIOCSIFMETRIC _IOW('I', 37, struct ifreq) -#define IBCS2_SIOCSARP _IOW('I', 38, struct arpreq) -#define IBCS2_SIOCGARP _IOWR('I', 39, struct arpreq) -#define IBCS2_SIOCDARP _IOW('I', 40, struct arpreq) -#define IBCS2_SIOCSIFNAME _IOW('I', 41, struct ifreq) -#define IBCS2_SIOCGIFONEP _IOWR('I', 42, struct ifreq) -#define IBCS2_SIOCSIFONEP _IOW('I', 43, struct ifreq) -#define IBCS2_SIOCGENADDR _IOWR('I', 65, struct ifreq) -#define IBCS2_SIOCSOCKSYS _IOW('I', 66, struct socksysreq) - -struct socksysreq { - int realargs[7]; -}; - -struct socknewproto { - int family; - int type; - int proto; - ibcs2_dev_t dev; - int flags; -}; - -int ibcs2_socksys(struct proc *, void *, register_t *); - -#endif /* _IBCS2_SOCKSYS_H */ diff --git a/sys/compat/ibcs2/ibcs2_stat.c b/sys/compat/ibcs2/ibcs2_stat.c deleted file mode 100644 index a0789772750..00000000000 --- a/sys/compat/ibcs2/ibcs2_stat.c +++ /dev/null @@ -1,288 +0,0 @@ -/* $OpenBSD: ibcs2_stat.c,v 1.13 2004/07/09 23:52:02 millert Exp $ */ -/* $NetBSD: ibcs2_stat.c,v 1.5 1996/05/03 17:05:32 christos Exp $ */ - -/* - * Copyright (c) 1995 Scott Bartram - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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/systm.h> -#include <sys/namei.h> -#include <sys/proc.h> -#include <sys/file.h> -#include <sys/stat.h> -#include <sys/filedesc.h> -#include <sys/ioctl.h> -#include <sys/kernel.h> -#include <sys/mount.h> -#include <sys/malloc.h> -#include <sys/vnode.h> -#include <sys/syscallargs.h> - -#include <uvm/uvm_extern.h> - -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_fcntl.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_stat.h> -#include <compat/ibcs2/ibcs2_statfs.h> -#include <compat/ibcs2/ibcs2_syscallargs.h> -#include <compat/ibcs2/ibcs2_ustat.h> -#include <compat/ibcs2/ibcs2_util.h> -#include <compat/ibcs2/ibcs2_utsname.h> - -static void bsd_stat2ibcs_stat(struct stat43 *, struct ibcs2_stat *); -static int cvt_statfs(struct statfs *, caddr_t, int); - -static void -bsd_stat2ibcs_stat(st, st4) - struct stat43 *st; - struct ibcs2_stat *st4; -{ - bzero(st4, sizeof(*st4)); - st4->st_dev = (ibcs2_dev_t)st->st_dev; - st4->st_ino = (ibcs2_ino_t)st->st_ino; - st4->st_mode = (ibcs2_mode_t)st->st_mode; - st4->st_nlink = (ibcs2_nlink_t)st->st_nlink; - st4->st_uid = (ibcs2_uid_t)st->st_uid; - st4->st_gid = (ibcs2_gid_t)st->st_gid; - st4->st_rdev = (ibcs2_dev_t)st->st_rdev; - st4->st_size = (ibcs2_off_t)st->st_size; - st4->st_atim = (ibcs2_time_t)st->st_atime; - st4->st_mtim = (ibcs2_time_t)st->st_mtime; - st4->st_ctim = (ibcs2_time_t)st->st_ctime; -} - -static int -cvt_statfs(sp, buf, len) - struct statfs *sp; - caddr_t buf; - int len; -{ - struct ibcs2_statfs ssfs; - - if (len < 0) - return (EINVAL); - if (len > sizeof(ssfs)) - len = sizeof(ssfs); - - bzero(&ssfs, sizeof ssfs); - ssfs.f_fstyp = 0; - ssfs.f_bsize = sp->f_bsize; - ssfs.f_frsize = 0; - ssfs.f_blocks = sp->f_blocks; - ssfs.f_bfree = sp->f_bfree; - ssfs.f_files = sp->f_files; - ssfs.f_ffree = sp->f_ffree; - ssfs.f_fname[0] = 0; - ssfs.f_fpack[0] = 0; - return copyout((caddr_t)&ssfs, buf, len); -} - -int -ibcs2_sys_statfs(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_statfs_args /* { - syscallarg(char *) path; - syscallarg(struct ibcs2_statfs *) buf; - syscallarg(int) len; - syscallarg(int) fstype; - } */ *uap = v; - register struct mount *mp; - register struct statfs *sp; - int error; - struct nameidata nd; - caddr_t sg = stackgap_init(p->p_emul); - - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p); - if ((error = namei(&nd)) != 0) - return (error); - mp = nd.ni_vp->v_mount; - sp = &mp->mnt_stat; - vrele(nd.ni_vp); - if ((error = VFS_STATFS(mp, sp, p)) != 0) - return (error); - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - return cvt_statfs(sp, (caddr_t)SCARG(uap, buf), SCARG(uap, len)); -} - -int -ibcs2_sys_fstatfs(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_fstatfs_args /* { - syscallarg(int) fd; - syscallarg(struct ibcs2_statfs *) buf; - syscallarg(int) len; - syscallarg(int) fstype; - } */ *uap = v; - struct file *fp; - struct mount *mp; - register struct statfs *sp; - int error; - - if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) - return (error); - mp = ((struct vnode *)fp->f_data)->v_mount; - sp = &mp->mnt_stat; - error = VFS_STATFS(mp, sp, p); - FRELE(fp); - if (error) - return (error); - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - return cvt_statfs(sp, (caddr_t)SCARG(uap, buf), SCARG(uap, len)); -} - -int -ibcs2_sys_stat(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_stat_args /* { - syscallarg(char *) path; - syscallarg(struct ibcs2_stat *) st; - } */ *uap = v; - struct stat43 st; - struct ibcs2_stat ibcs2_st; - struct compat_43_sys_stat_args cup; - int error; - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - SCARG(&cup, path) = SCARG(uap, path); - - if ((error = compat_43_sys_stat(p, &cup, retval)) != 0) - return error; - if ((error = copyin(SCARG(&cup, ub), &st, sizeof(st))) != 0) - return error; - bsd_stat2ibcs_stat(&st, &ibcs2_st); - return copyout((caddr_t)&ibcs2_st, (caddr_t)SCARG(uap, st), - ibcs2_stat_len); -} - -int -ibcs2_sys_lstat(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_lstat_args /* { - syscallarg(char *) path; - syscallarg(struct ibcs2_stat *) st; - } */ *uap = v; - struct stat43 st; - struct ibcs2_stat ibcs2_st; - struct compat_43_sys_lstat_args cup; - int error; - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); - IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - SCARG(&cup, path) = SCARG(uap, path); - - if ((error = compat_43_sys_lstat(p, &cup, retval)) != 0) - return error; - if ((error = copyin(SCARG(&cup, ub), &st, sizeof(st))) != 0) - return error; - bsd_stat2ibcs_stat(&st, &ibcs2_st); - return copyout((caddr_t)&ibcs2_st, (caddr_t)SCARG(uap, st), - ibcs2_stat_len); -} - -int -ibcs2_sys_fstat(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_fstat_args /* { - syscallarg(int) fd; - syscallarg(struct ibcs2_stat *) st; - } */ *uap = v; - struct stat43 st; - struct ibcs2_stat ibcs2_st; - struct compat_43_sys_fstat_args cup; - int error; - caddr_t sg = stackgap_init(p->p_emul); - - SCARG(&cup, fd) = SCARG(uap, fd); - SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(st)); - if ((error = compat_43_sys_fstat(p, &cup, retval)) != 0) - return error; - if ((error = copyin(SCARG(&cup, sb), &st, sizeof(st))) != 0) - return error; - bsd_stat2ibcs_stat(&st, &ibcs2_st); - return copyout((caddr_t)&ibcs2_st, (caddr_t)SCARG(uap, st), - ibcs2_stat_len); -} - -int -ibcs2_sys_utssys(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ibcs2_sys_utssys_args /* { - syscallarg(int) a1; - syscallarg(int) a2; - syscallarg(int) flag; - } */ *uap = v; - - switch (SCARG(uap, flag)) { - case 0: /* uname(2) */ - { - struct ibcs2_utsname sut; - extern char machine[]; - - bzero(&sut, ibcs2_utsname_len); - bcopy(ostype, sut.sysname, sizeof(sut.sysname) - 1); - bcopy(hostname, sut.nodename, sizeof(sut.nodename)); - sut.nodename[sizeof(sut.nodename)-1] = '\0'; - bcopy(osrelease, sut.release, sizeof(sut.release) - 1); - strlcpy(sut.version, "1", sizeof(sut.version)); - bcopy(machine, sut.machine, sizeof(sut.machine) - 1); - - return copyout((caddr_t)&sut, (caddr_t)SCARG(uap, a1), - ibcs2_utsname_len); - } - - case 2: /* ustat(2) */ - { - return ENOSYS; /* XXX - TODO */ - } - - default: - return ENOSYS; - } -} diff --git a/sys/compat/ibcs2/ibcs2_stat.h b/sys/compat/ibcs2/ibcs2_stat.h deleted file mode 100644 index f129bb27659..00000000000 --- a/sys/compat/ibcs2/ibcs2_stat.h +++ /dev/null @@ -1,90 +0,0 @@ -/* $OpenBSD: ibcs2_stat.h,v 1.2 1996/08/02 20:35:11 niklas Exp $ */ -/* $NetBSD: ibcs2_stat.h,v 1.2 1994/10/26 02:53:03 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_STAT_H -#define _IBCS2_STAT_H - -#include <compat/ibcs2/ibcs2_types.h> - -struct ibcs2_stat { - ibcs2_dev_t st_dev; - ibcs2_ino_t st_ino; - ibcs2_mode_t st_mode; - ibcs2_nlink_t st_nlink; - ibcs2_uid_t st_uid; - ibcs2_gid_t st_gid; - ibcs2_dev_t st_rdev; - ibcs2_off_t st_size; - ibcs2_time_t st_atim; - ibcs2_time_t st_mtim; - ibcs2_time_t st_ctim; -}; - -#define ibcs2_stat_len (sizeof(struct ibcs2_stat)) - -#define IBCS2_S_IFMT 0xf000 -#define IBCS2_S_IFIFO 0x1000 -#define IBCS2_S_IFCHR 0x2000 -#define IBCS2_S_IFDIR 0x4000 -#define IBCS2_S_IFBLK 0x6000 -#define IBCS2_S_IFREG 0x8000 -#define IBCS2_S_IFSOCK 0xc000 - -#define IBCS2_S_IFNAM 0x5000 -#define IBCS2_S_IFLNK 0xa000 - -#define IBCS2_S_ISUID 0x0800 -#define IBCS2_S_ISGID 0x0400 -#define IBCS2_S_ISVTX 0x0200 - -#define IBCS2_S_IRWXU 0x01c0 -#define IBCS2_S_IRUSR 0x0100 -#define IBCS2_S_IWUSR 0x0080 -#define IBCS2_S_IXUSR 0x0040 -#define IBCS2_S_IRWXG 0x0038 -#define IBCS2_S_IRGRP 0x0020 -#define IBCS2_S_IWGRP 0x000f -#define IBCS2_S_IXGRP 0x0008 -#define IBCS2_S_IRWXO 0x0007 -#define IBCS2_S_IROTH 0x0004 -#define IBCS2_S_IWOTH 0x0002 -#define IBCS2_S_IXOTH 0x0001 - -#define IBCS2_S_ISFIFO(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFIFO) -#define IBCS2_S_ISCHR(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFCHR) -#define IBCS2_S_ISDIR(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFDIR) -#define IBCS2_S_ISBLK(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFBLK) -#define IBCS2_S_ISREG(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFREG) -#define IBCS2_S_ISSOCK(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFSOCK) - -#endif /* _IBCS2_STAT_H */ diff --git a/sys/compat/ibcs2/ibcs2_statfs.h b/sys/compat/ibcs2/ibcs2_statfs.h deleted file mode 100644 index ca8ccd5508f..00000000000 --- a/sys/compat/ibcs2/ibcs2_statfs.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $OpenBSD: ibcs2_statfs.h,v 1.2 1996/08/02 20:35:12 niklas Exp $ */ -/* $NetBSD: ibcs2_statfs.h,v 1.2 1994/10/26 02:53:06 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_STATFS_H -#define _IBCS2_STATFS_H - -struct ibcs2_statfs { - short f_fstyp; - long f_bsize; - long f_frsize; - long f_blocks; - long f_bfree; - long f_files; - long f_ffree; - char f_fname[6]; - char f_fpack[6]; -}; - -#endif /* _IBCS2_STATFS_H */ diff --git a/sys/compat/ibcs2/ibcs2_stropts.h b/sys/compat/ibcs2/ibcs2_stropts.h deleted file mode 100644 index 0ebd25d4527..00000000000 --- a/sys/compat/ibcs2/ibcs2_stropts.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: ibcs2_stropts.h,v 1.3 1996/08/02 20:35:12 niklas Exp $ */ -/* $NetBSD: ibcs2_stropts.h,v 1.2 1996/05/03 17:05:33 christos Exp $ */ - -/* - * ibcs2_stropts.h - * Copyright (c) 1995 Scott Bartram - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_STROPTS_H -#define _IBCS2_STROPTS_H - -#define IBCS2_STR ('S'<<8) -#define IBCS2_I_NREAD (IBCS2_STR|01) -#define IBCS2_I_PUSH (IBCS2_STR|02) -#define IBCS2_I_POP (IBCS2_STR|03) -#define IBCS2_I_LOOK (IBCS2_STR|04) -#define IBCS2_I_FLUSH (IBCS2_STR|05) -#define IBCS2_I_SRDOPT (IBCS2_STR|06) -#define IBCS2_I_GRDOPT (IBCS2_STR|07) -#define IBCS2_I_STR (IBCS2_STR|010) -#define IBCS2_I_SETSIG (IBCS2_STR|011) -#define IBCS2_I_GETSIG (IBCS2_STR|012) -#define IBCS2_I_FIND (IBCS2_STR|013) -#define IBCS2_I_LINK (IBCS2_STR|014) -#define IBCS2_I_UNLINK (IBCS2_STR|015) -#define IBCS2_I_PEEK (IBCS2_STR|017) -#define IBCS2_I_FDINSERT (IBCS2_STR|020) -#define IBCS2_I_SENDFD (IBCS2_STR|021) -#define IBCS2_I_RECVFD (IBCS2_STR|022) - -#endif /* _IBCS2_STROPTS_H */ diff --git a/sys/compat/ibcs2/ibcs2_syscall.h b/sys/compat/ibcs2/ibcs2_syscall.h deleted file mode 100644 index 954bd1ea5c2..00000000000 --- a/sys/compat/ibcs2/ibcs2_syscall.h +++ /dev/null @@ -1,267 +0,0 @@ -/* $OpenBSD: ibcs2_syscall.h,v 1.10 2007/11/27 18:05:59 art Exp $ */ - -/* - * System call numbers. - * - * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.8 2002/03/14 03:16:03 millert Exp - */ - -/* syscall: "syscall" ret: "int" args: */ -#define IBCS2_SYS_syscall 0 - -/* syscall: "exit" ret: "int" args: "int" */ -#define IBCS2_SYS_exit 1 - -/* syscall: "fork" ret: "int" args: */ -#define IBCS2_SYS_fork 2 - -/* syscall: "read" ret: "int" args: "int" "char *" "u_int" */ -#define IBCS2_SYS_read 3 - -/* syscall: "write" ret: "int" args: "int" "char *" "u_int" */ -#define IBCS2_SYS_write 4 - -/* syscall: "open" ret: "int" args: "char *" "int" "int" */ -#define IBCS2_SYS_open 5 - -/* syscall: "close" ret: "int" args: "int" */ -#define IBCS2_SYS_close 6 - -/* syscall: "waitsys" ret: "int" args: "int" "int" "int" */ -#define IBCS2_SYS_waitsys 7 - -/* syscall: "creat" ret: "int" args: "char *" "int" */ -#define IBCS2_SYS_creat 8 - -/* syscall: "link" ret: "int" args: "char *" "char *" */ -#define IBCS2_SYS_link 9 - -/* syscall: "unlink" ret: "int" args: "char *" */ -#define IBCS2_SYS_unlink 10 - -/* syscall: "execv" ret: "int" args: "char *" "char **" */ -#define IBCS2_SYS_execv 11 - -/* syscall: "chdir" ret: "int" args: "char *" */ -#define IBCS2_SYS_chdir 12 - -/* syscall: "time" ret: "int" args: "ibcs2_time_t *" */ -#define IBCS2_SYS_time 13 - -/* syscall: "mknod" ret: "int" args: "char *" "int" "int" */ -#define IBCS2_SYS_mknod 14 - -/* syscall: "chmod" ret: "int" args: "char *" "int" */ -#define IBCS2_SYS_chmod 15 - -/* syscall: "chown" ret: "int" args: "char *" "int" "int" */ -#define IBCS2_SYS_chown 16 - -/* syscall: "obreak" ret: "int" args: "caddr_t" */ -#define IBCS2_SYS_obreak 17 - -/* syscall: "stat" ret: "int" args: "char *" "struct ibcs2_stat *" */ -#define IBCS2_SYS_stat 18 - -/* syscall: "lseek" ret: "long" args: "int" "long" "int" */ -#define IBCS2_SYS_lseek 19 - -/* syscall: "getpid" ret: "pid_t" args: */ -#define IBCS2_SYS_getpid 20 - -/* syscall: "mount" ret: "int" args: "char *" "char *" "int" "int" "char *" "int" */ -#define IBCS2_SYS_mount 21 - -/* syscall: "umount" ret: "int" args: "char *" */ -#define IBCS2_SYS_umount 22 - -/* syscall: "setuid" ret: "int" args: "int" */ -#define IBCS2_SYS_setuid 23 - -/* syscall: "getuid" ret: "uid_t" args: */ -#define IBCS2_SYS_getuid 24 - -/* syscall: "stime" ret: "int" args: "long *" */ -#define IBCS2_SYS_stime 25 - -/* syscall: "alarm" ret: "int" args: "unsigned" */ -#define IBCS2_SYS_alarm 27 - -/* syscall: "fstat" ret: "int" args: "int" "struct ibcs2_stat *" */ -#define IBCS2_SYS_fstat 28 - -/* syscall: "pause" ret: "int" args: */ -#define IBCS2_SYS_pause 29 - -/* syscall: "utime" ret: "int" args: "char *" "struct ibcs2_utimbuf *" */ -#define IBCS2_SYS_utime 30 - -/* syscall: "access" ret: "int" args: "char *" "int" */ -#define IBCS2_SYS_access 33 - -/* syscall: "nice" ret: "int" args: "int" */ -#define IBCS2_SYS_nice 34 - -/* syscall: "statfs" ret: "int" args: "char *" "struct ibcs2_statfs *" "int" "int" */ -#define IBCS2_SYS_statfs 35 - -/* syscall: "sync" ret: "int" args: */ -#define IBCS2_SYS_sync 36 - -/* syscall: "kill" ret: "int" args: "int" "int" */ -#define IBCS2_SYS_kill 37 - -/* syscall: "fstatfs" ret: "int" args: "int" "struct ibcs2_statfs *" "int" "int" */ -#define IBCS2_SYS_fstatfs 38 - -/* syscall: "pgrpsys" ret: "int" args: "int" "caddr_t" "int" "int" */ -#define IBCS2_SYS_pgrpsys 39 - -/* syscall: "dup" ret: "int" args: "u_int" */ -#define IBCS2_SYS_dup 41 - -/* syscall: "opipe" ret: "int" args: */ -#define IBCS2_SYS_opipe 42 - -/* syscall: "times" ret: "int" args: "struct tms *" */ -#define IBCS2_SYS_times 43 - -/* syscall: "plock" ret: "int" args: "int" */ -#define IBCS2_SYS_plock 45 - -/* syscall: "setgid" ret: "int" args: "int" */ -#define IBCS2_SYS_setgid 46 - -/* syscall: "getgid" ret: "gid_t" args: */ -#define IBCS2_SYS_getgid 47 - -/* syscall: "sigsys" ret: "int" args: "int" "ibcs2_sig_t" */ -#define IBCS2_SYS_sigsys 48 - -/* syscall: "msgsys" ret: "int" args: "int" "int" "int" "int" "int" "int" */ -#define IBCS2_SYS_msgsys 49 - -/* syscall: "sysi86" ret: "int" args: "int" "int" */ -#define IBCS2_SYS_sysi86 50 - -/* syscall: "shmsys" ret: "int" args: "int" "int" "int" "int" */ -#define IBCS2_SYS_shmsys 52 - -/* syscall: "semsys" ret: "int" args: "int" "int" "int" "int" "int" */ -#define IBCS2_SYS_semsys 53 - -/* syscall: "ioctl" ret: "int" args: "int" "int" "caddr_t" */ -#define IBCS2_SYS_ioctl 54 - -/* syscall: "uadmin" ret: "int" args: "int" "int" "caddr_t" */ -#define IBCS2_SYS_uadmin 55 - -/* syscall: "utssys" ret: "int" args: "int" "int" "int" */ -#define IBCS2_SYS_utssys 57 - -/* syscall: "execve" ret: "int" args: "char *" "char **" "char **" */ -#define IBCS2_SYS_execve 59 - -/* syscall: "umask" ret: "int" args: "int" */ -#define IBCS2_SYS_umask 60 - -/* syscall: "chroot" ret: "int" args: "char *" */ -#define IBCS2_SYS_chroot 61 - -/* syscall: "fcntl" ret: "int" args: "int" "int" "char *" */ -#define IBCS2_SYS_fcntl 62 - -/* syscall: "ulimit" ret: "long" args: "int" "int" */ -#define IBCS2_SYS_ulimit 63 - - /* 70 is obsolete rfs_advfs */ - /* 71 is obsolete rfs_unadvfs */ - /* 72 is obsolete rfs_rmount */ - /* 73 is obsolete rfs_rumount */ - /* 74 is obsolete rfs_rfstart */ - /* 75 is obsolete rfs_sigret */ - /* 76 is obsolete rfs_rdebug */ - /* 77 is obsolete rfs_rfstop */ -/* syscall: "rmdir" ret: "int" args: "char *" */ -#define IBCS2_SYS_rmdir 79 - -/* syscall: "mkdir" ret: "int" args: "char *" "int" */ -#define IBCS2_SYS_mkdir 80 - -/* syscall: "getdents" ret: "int" args: "int" "char *" "int" */ -#define IBCS2_SYS_getdents 81 - -/* syscall: "sysfs" ret: "int" args: "int" "caddr_t" "char *" */ -#define IBCS2_SYS_sysfs 84 - -/* syscall: "getmsg" ret: "int" args: "int" "struct ibcs2_stropts *" "struct ibcs2_stropts *" "int *" */ -#define IBCS2_SYS_getmsg 85 - -/* syscall: "putmsg" ret: "int" args: "int" "struct ibcs2_stropts *" "struct ibcs2_stropts *" "int" */ -#define IBCS2_SYS_putmsg 86 - -/* syscall: "poll" ret: "int" args: "struct pollfd *" "u_long" "int" */ -#define IBCS2_SYS_poll 87 - -/* syscall: "symlink" ret: "int" args: "char *" "char *" */ -#define IBCS2_SYS_symlink 90 - -/* syscall: "lstat" ret: "int" args: "char *" "struct ibcs2_stat *" */ -#define IBCS2_SYS_lstat 91 - -/* syscall: "readlink" ret: "int" args: "char *" "char *" "int" */ -#define IBCS2_SYS_readlink 92 - -/* syscall: "sigreturn" ret: "int" args: "struct sigcontext *" */ -#define IBCS2_SYS_sigreturn 103 - -/* syscall: "rdchk" ret: "int" args: "int" */ -#define IBCS2_SYS_rdchk 135 - -/* syscall: "chsize" ret: "int" args: "int" "long" */ -#define IBCS2_SYS_chsize 138 - -/* syscall: "ftime" ret: "int" args: "struct xenix_timeb *" */ -#define IBCS2_SYS_ftime 139 - -/* syscall: "nap" ret: "int" args: "int" */ -#define IBCS2_SYS_nap 140 - -/* syscall: "select" ret: "int" args: "u_int" "fd_set *" "fd_set *" "fd_set *" "struct timeval *" */ -#define IBCS2_SYS_select 164 - -/* syscall: "eaccess" ret: "int" args: "char *" "int" */ -#define IBCS2_SYS_eaccess 165 - -/* syscall: "sigaction" ret: "int" args: "int" "struct ibcs2_sigaction *" "struct ibcs2_sigaction *" */ -#define IBCS2_SYS_sigaction 167 - -/* syscall: "sigprocmask" ret: "int" args: "int" "ibcs2_sigset_t *" "ibcs2_sigset_t *" */ -#define IBCS2_SYS_sigprocmask 168 - -/* syscall: "sigpending" ret: "int" args: "ibcs2_sigset_t *" */ -#define IBCS2_SYS_sigpending 169 - -/* syscall: "sigsuspend" ret: "int" args: "ibcs2_sigset_t *" */ -#define IBCS2_SYS_sigsuspend 170 - -/* syscall: "getgroups" ret: "int" args: "int" "ibcs2_gid_t *" */ -#define IBCS2_SYS_getgroups 171 - -/* syscall: "setgroups" ret: "int" args: "int" "ibcs2_gid_t *" */ -#define IBCS2_SYS_setgroups 172 - -/* syscall: "sysconf" ret: "int" args: "int" */ -#define IBCS2_SYS_sysconf 173 - -/* syscall: "pathconf" ret: "int" args: "char *" "int" */ -#define IBCS2_SYS_pathconf 174 - -/* syscall: "fpathconf" ret: "int" args: "int" "int" */ -#define IBCS2_SYS_fpathconf 175 - -/* syscall: "rename" ret: "int" args: "char *" "char *" */ -#define IBCS2_SYS_rename 176 - -#define IBCS2_SYS_MAXSYSCALL 177 diff --git a/sys/compat/ibcs2/ibcs2_syscallargs.h b/sys/compat/ibcs2/ibcs2_syscallargs.h deleted file mode 100644 index fcf8a71d964..00000000000 --- a/sys/compat/ibcs2/ibcs2_syscallargs.h +++ /dev/null @@ -1,456 +0,0 @@ -/* $OpenBSD: ibcs2_syscallargs.h,v 1.12 2007/11/27 18:05:59 art Exp $ */ - -/* - * System call argument lists. - * - * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.8 2002/03/14 03:16:03 millert Exp - */ - -#ifdef syscallarg -#undef syscallarg -#endif - -#define syscallarg(x) \ - union { \ - register_t pad; \ - struct { x datum; } le; \ - struct { \ - int8_t pad[ (sizeof (register_t) < sizeof (x)) \ - ? 0 \ - : sizeof (register_t) - sizeof (x)]; \ - x datum; \ - } be; \ - } - -struct ibcs2_sys_read_args { - syscallarg(int) fd; - syscallarg(char *) buf; - syscallarg(u_int) nbytes; -}; - -struct ibcs2_sys_open_args { - syscallarg(char *) path; - syscallarg(int) flags; - syscallarg(int) mode; -}; - -struct ibcs2_sys_waitsys_args { - syscallarg(int) a1; - syscallarg(int) a2; - syscallarg(int) a3; -}; - -struct ibcs2_sys_creat_args { - syscallarg(char *) path; - syscallarg(int) mode; -}; - -struct ibcs2_sys_unlink_args { - syscallarg(char *) path; -}; - -struct ibcs2_sys_execv_args { - syscallarg(char *) path; - syscallarg(char **) argp; -}; - -struct ibcs2_sys_chdir_args { - syscallarg(char *) path; -}; - -struct ibcs2_sys_time_args { - syscallarg(ibcs2_time_t *) tp; -}; - -struct ibcs2_sys_mknod_args { - syscallarg(char *) path; - syscallarg(int) mode; - syscallarg(int) dev; -}; - -struct ibcs2_sys_chmod_args { - syscallarg(char *) path; - syscallarg(int) mode; -}; - -struct ibcs2_sys_chown_args { - syscallarg(char *) path; - syscallarg(int) uid; - syscallarg(int) gid; -}; - -struct ibcs2_sys_stat_args { - syscallarg(char *) path; - syscallarg(struct ibcs2_stat *) st; -}; - -struct ibcs2_sys_mount_args { - syscallarg(char *) special; - syscallarg(char *) dir; - syscallarg(int) flags; - syscallarg(int) fstype; - syscallarg(char *) data; - syscallarg(int) len; -}; - -struct ibcs2_sys_umount_args { - syscallarg(char *) name; -}; - -struct ibcs2_sys_setuid_args { - syscallarg(int) uid; -}; - -struct ibcs2_sys_stime_args { - syscallarg(long *) timep; -}; - -struct ibcs2_sys_alarm_args { - syscallarg(unsigned) sec; -}; - -struct ibcs2_sys_fstat_args { - syscallarg(int) fd; - syscallarg(struct ibcs2_stat *) st; -}; - -struct ibcs2_sys_utime_args { - syscallarg(char *) path; - syscallarg(struct ibcs2_utimbuf *) buf; -}; - -struct ibcs2_sys_access_args { - syscallarg(char *) path; - syscallarg(int) flags; -}; - -struct ibcs2_sys_nice_args { - syscallarg(int) incr; -}; - -struct ibcs2_sys_statfs_args { - syscallarg(char *) path; - syscallarg(struct ibcs2_statfs *) buf; - syscallarg(int) len; - syscallarg(int) fstype; -}; - -struct ibcs2_sys_kill_args { - syscallarg(int) pid; - syscallarg(int) signo; -}; - -struct ibcs2_sys_fstatfs_args { - syscallarg(int) fd; - syscallarg(struct ibcs2_statfs *) buf; - syscallarg(int) len; - syscallarg(int) fstype; -}; - -struct ibcs2_sys_pgrpsys_args { - syscallarg(int) type; - syscallarg(caddr_t) dummy; - syscallarg(int) pid; - syscallarg(int) pgid; -}; - -struct ibcs2_sys_times_args { - syscallarg(struct tms *) tp; -}; - -struct ibcs2_sys_plock_args { - syscallarg(int) cmd; -}; - -struct ibcs2_sys_setgid_args { - syscallarg(int) gid; -}; - -struct ibcs2_sys_sigsys_args { - syscallarg(int) sig; - syscallarg(ibcs2_sig_t) fp; -}; - -struct ibcs2_sys_msgsys_args { - syscallarg(int) which; - syscallarg(int) a2; - syscallarg(int) a3; - syscallarg(int) a4; - syscallarg(int) a5; - syscallarg(int) a6; -}; - -struct ibcs2_sys_sysi86_args { - syscallarg(int) cmd; - syscallarg(int) arg; -}; - -struct ibcs2_sys_shmsys_args { - syscallarg(int) which; - syscallarg(int) a2; - syscallarg(int) a3; - syscallarg(int) a4; -}; - -struct ibcs2_sys_semsys_args { - syscallarg(int) which; - syscallarg(int) a2; - syscallarg(int) a3; - syscallarg(int) a4; - syscallarg(int) a5; -}; - -struct ibcs2_sys_ioctl_args { - syscallarg(int) fd; - syscallarg(int) cmd; - syscallarg(caddr_t) data; -}; - -struct ibcs2_sys_uadmin_args { - syscallarg(int) cmd; - syscallarg(int) func; - syscallarg(caddr_t) data; -}; - -struct ibcs2_sys_utssys_args { - syscallarg(int) a1; - syscallarg(int) a2; - syscallarg(int) flag; -}; - -struct ibcs2_sys_execve_args { - syscallarg(char *) path; - syscallarg(char **) argp; - syscallarg(char **) envp; -}; - -struct ibcs2_sys_fcntl_args { - syscallarg(int) fd; - syscallarg(int) cmd; - syscallarg(char *) arg; -}; - -struct ibcs2_sys_ulimit_args { - syscallarg(int) cmd; - syscallarg(int) newlimit; -}; - -struct ibcs2_sys_rmdir_args { - syscallarg(char *) path; -}; - -struct ibcs2_sys_mkdir_args { - syscallarg(char *) path; - syscallarg(int) mode; -}; - -struct ibcs2_sys_getdents_args { - syscallarg(int) fd; - syscallarg(char *) buf; - syscallarg(int) nbytes; -}; - -struct ibcs2_sys_sysfs_args { - syscallarg(int) cmd; - syscallarg(caddr_t) d1; - syscallarg(char *) buf; -}; - -struct ibcs2_sys_getmsg_args { - syscallarg(int) fd; - syscallarg(struct ibcs2_stropts *) ctl; - syscallarg(struct ibcs2_stropts *) dat; - syscallarg(int *) flags; -}; - -struct ibcs2_sys_putmsg_args { - syscallarg(int) fd; - syscallarg(struct ibcs2_stropts *) ctl; - syscallarg(struct ibcs2_stropts *) dat; - syscallarg(int) flags; -}; - -struct ibcs2_sys_symlink_args { - syscallarg(char *) path; - syscallarg(char *) link; -}; - -struct ibcs2_sys_lstat_args { - syscallarg(char *) path; - syscallarg(struct ibcs2_stat *) st; -}; - -struct ibcs2_sys_readlink_args { - syscallarg(char *) path; - syscallarg(char *) buf; - syscallarg(int) count; -}; - -struct xenix_sys_rdchk_args { - syscallarg(int) fd; -}; - -struct xenix_sys_chsize_args { - syscallarg(int) fd; - syscallarg(long) size; -}; - -struct xenix_sys_ftime_args { - syscallarg(struct xenix_timeb *) tp; -}; - -struct xenix_sys_nap_args { - syscallarg(int) millisec; -}; - -struct ibcs2_sys_eaccess_args { - syscallarg(char *) path; - syscallarg(int) flags; -}; - -struct ibcs2_sys_sigaction_args { - syscallarg(int) signum; - syscallarg(struct ibcs2_sigaction *) nsa; - syscallarg(struct ibcs2_sigaction *) osa; -}; - -struct ibcs2_sys_sigprocmask_args { - syscallarg(int) how; - syscallarg(ibcs2_sigset_t *) set; - syscallarg(ibcs2_sigset_t *) oset; -}; - -struct ibcs2_sys_sigpending_args { - syscallarg(ibcs2_sigset_t *) mask; -}; - -struct ibcs2_sys_sigsuspend_args { - syscallarg(ibcs2_sigset_t *) mask; -}; - -struct ibcs2_sys_getgroups_args { - syscallarg(int) gidsetsize; - syscallarg(ibcs2_gid_t *) gidset; -}; - -struct ibcs2_sys_setgroups_args { - syscallarg(int) gidsetsize; - syscallarg(ibcs2_gid_t *) gidset; -}; - -struct ibcs2_sys_sysconf_args { - syscallarg(int) name; -}; - -struct ibcs2_sys_pathconf_args { - syscallarg(char *) path; - syscallarg(int) name; -}; - -struct ibcs2_sys_fpathconf_args { - syscallarg(int) fd; - syscallarg(int) name; -}; - -struct ibcs2_sys_rename_args { - syscallarg(char *) from; - syscallarg(char *) to; -}; - -/* - * System call prototypes. - */ - -int sys_nosys(struct proc *, void *, register_t *); -int sys_exit(struct proc *, void *, register_t *); -int sys_fork(struct proc *, void *, register_t *); -int ibcs2_sys_read(struct proc *, void *, register_t *); -int sys_write(struct proc *, void *, register_t *); -int ibcs2_sys_open(struct proc *, void *, register_t *); -int sys_close(struct proc *, void *, register_t *); -int ibcs2_sys_waitsys(struct proc *, void *, register_t *); -int ibcs2_sys_creat(struct proc *, void *, register_t *); -int sys_link(struct proc *, void *, register_t *); -int ibcs2_sys_unlink(struct proc *, void *, register_t *); -int ibcs2_sys_execv(struct proc *, void *, register_t *); -int ibcs2_sys_chdir(struct proc *, void *, register_t *); -int ibcs2_sys_time(struct proc *, void *, register_t *); -int ibcs2_sys_mknod(struct proc *, void *, register_t *); -int ibcs2_sys_chmod(struct proc *, void *, register_t *); -int ibcs2_sys_chown(struct proc *, void *, register_t *); -int sys_obreak(struct proc *, void *, register_t *); -int ibcs2_sys_stat(struct proc *, void *, register_t *); -int compat_43_sys_lseek(struct proc *, void *, register_t *); -int sys_getpid(struct proc *, void *, register_t *); -int ibcs2_sys_mount(struct proc *, void *, register_t *); -int ibcs2_sys_umount(struct proc *, void *, register_t *); -int ibcs2_sys_setuid(struct proc *, void *, register_t *); -int sys_getuid(struct proc *, void *, register_t *); -int ibcs2_sys_stime(struct proc *, void *, register_t *); -int ibcs2_sys_alarm(struct proc *, void *, register_t *); -int ibcs2_sys_fstat(struct proc *, void *, register_t *); -int ibcs2_sys_pause(struct proc *, void *, register_t *); -int ibcs2_sys_utime(struct proc *, void *, register_t *); -int ibcs2_sys_access(struct proc *, void *, register_t *); -int ibcs2_sys_nice(struct proc *, void *, register_t *); -int ibcs2_sys_statfs(struct proc *, void *, register_t *); -int sys_sync(struct proc *, void *, register_t *); -int ibcs2_sys_kill(struct proc *, void *, register_t *); -int ibcs2_sys_fstatfs(struct proc *, void *, register_t *); -int ibcs2_sys_pgrpsys(struct proc *, void *, register_t *); -int sys_dup(struct proc *, void *, register_t *); -int sys_opipe(struct proc *, void *, register_t *); -int ibcs2_sys_times(struct proc *, void *, register_t *); -int ibcs2_sys_plock(struct proc *, void *, register_t *); -int ibcs2_sys_setgid(struct proc *, void *, register_t *); -int sys_getgid(struct proc *, void *, register_t *); -int ibcs2_sys_sigsys(struct proc *, void *, register_t *); -#ifdef SYSVMSG -int ibcs2_sys_msgsys(struct proc *, void *, register_t *); -#else -#endif -int ibcs2_sys_sysi86(struct proc *, void *, register_t *); -#ifdef SYSVSHM -int ibcs2_sys_shmsys(struct proc *, void *, register_t *); -#else -#endif -#ifdef SYSVSEM -int ibcs2_sys_semsys(struct proc *, void *, register_t *); -#else -#endif -int ibcs2_sys_ioctl(struct proc *, void *, register_t *); -int ibcs2_sys_uadmin(struct proc *, void *, register_t *); -int ibcs2_sys_utssys(struct proc *, void *, register_t *); -int ibcs2_sys_execve(struct proc *, void *, register_t *); -int sys_umask(struct proc *, void *, register_t *); -int sys_chroot(struct proc *, void *, register_t *); -int ibcs2_sys_fcntl(struct proc *, void *, register_t *); -int ibcs2_sys_ulimit(struct proc *, void *, register_t *); -int ibcs2_sys_rmdir(struct proc *, void *, register_t *); -int ibcs2_sys_mkdir(struct proc *, void *, register_t *); -int ibcs2_sys_getdents(struct proc *, void *, register_t *); -int ibcs2_sys_sysfs(struct proc *, void *, register_t *); -int ibcs2_sys_getmsg(struct proc *, void *, register_t *); -int ibcs2_sys_putmsg(struct proc *, void *, register_t *); -int sys_poll(struct proc *, void *, register_t *); -int ibcs2_sys_symlink(struct proc *, void *, register_t *); -int ibcs2_sys_lstat(struct proc *, void *, register_t *); -int ibcs2_sys_readlink(struct proc *, void *, register_t *); -int sys_sigreturn(struct proc *, void *, register_t *); -int xenix_sys_rdchk(struct proc *, void *, register_t *); -int xenix_sys_chsize(struct proc *, void *, register_t *); -int xenix_sys_ftime(struct proc *, void *, register_t *); -int xenix_sys_nap(struct proc *, void *, register_t *); -int sys_select(struct proc *, void *, register_t *); -int ibcs2_sys_eaccess(struct proc *, void *, register_t *); -int ibcs2_sys_sigaction(struct proc *, void *, register_t *); -int ibcs2_sys_sigprocmask(struct proc *, void *, register_t *); -int ibcs2_sys_sigpending(struct proc *, void *, register_t *); -int ibcs2_sys_sigsuspend(struct proc *, void *, register_t *); -int ibcs2_sys_getgroups(struct proc *, void *, register_t *); -int ibcs2_sys_setgroups(struct proc *, void *, register_t *); -int ibcs2_sys_sysconf(struct proc *, void *, register_t *); -int ibcs2_sys_pathconf(struct proc *, void *, register_t *); -int ibcs2_sys_fpathconf(struct proc *, void *, register_t *); -int ibcs2_sys_rename(struct proc *, void *, register_t *); diff --git a/sys/compat/ibcs2/ibcs2_syscalls.c b/sys/compat/ibcs2/ibcs2_syscalls.c deleted file mode 100644 index fa8d949d350..00000000000 --- a/sys/compat/ibcs2/ibcs2_syscalls.c +++ /dev/null @@ -1,200 +0,0 @@ -/* $OpenBSD: ibcs2_syscalls.c,v 1.10 2007/11/27 18:05:59 art Exp $ */ - -/* - * System call names. - * - * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.8 2002/03/14 03:16:03 millert Exp - */ - -char *ibcs2_syscallnames[] = { - "syscall", /* 0 = syscall */ - "exit", /* 1 = exit */ - "fork", /* 2 = fork */ - "read", /* 3 = read */ - "write", /* 4 = write */ - "open", /* 5 = open */ - "close", /* 6 = close */ - "waitsys", /* 7 = waitsys */ - "creat", /* 8 = creat */ - "link", /* 9 = link */ - "unlink", /* 10 = unlink */ - "execv", /* 11 = execv */ - "chdir", /* 12 = chdir */ - "time", /* 13 = time */ - "mknod", /* 14 = mknod */ - "chmod", /* 15 = chmod */ - "chown", /* 16 = chown */ - "obreak", /* 17 = obreak */ - "stat", /* 18 = stat */ - "lseek", /* 19 = lseek */ - "getpid", /* 20 = getpid */ - "mount", /* 21 = mount */ - "umount", /* 22 = umount */ - "setuid", /* 23 = setuid */ - "getuid", /* 24 = getuid */ - "stime", /* 25 = stime */ - "#26 (unimplemented ibcs2_ptrace)", /* 26 = unimplemented ibcs2_ptrace */ - "alarm", /* 27 = alarm */ - "fstat", /* 28 = fstat */ - "pause", /* 29 = pause */ - "utime", /* 30 = utime */ - "#31 (unimplemented was stty)", /* 31 = unimplemented was stty */ - "#32 (unimplemented was gtty)", /* 32 = unimplemented was gtty */ - "access", /* 33 = access */ - "nice", /* 34 = nice */ - "statfs", /* 35 = statfs */ - "sync", /* 36 = sync */ - "kill", /* 37 = kill */ - "fstatfs", /* 38 = fstatfs */ - "pgrpsys", /* 39 = pgrpsys */ - "#40 (unimplemented ibcs2_xenix)", /* 40 = unimplemented ibcs2_xenix */ - "dup", /* 41 = dup */ - "opipe", /* 42 = opipe */ - "times", /* 43 = times */ - "#44 (unimplemented profil)", /* 44 = unimplemented profil */ - "plock", /* 45 = plock */ - "setgid", /* 46 = setgid */ - "getgid", /* 47 = getgid */ - "sigsys", /* 48 = sigsys */ -#ifdef SYSVMSG - "msgsys", /* 49 = msgsys */ -#else - "#49 (unimplemented msgsys)", /* 49 = unimplemented msgsys */ -#endif - "sysi86", /* 50 = sysi86 */ - "#51 (unimplemented ibcs2_acct)", /* 51 = unimplemented ibcs2_acct */ -#ifdef SYSVSHM - "shmsys", /* 52 = shmsys */ -#else - "#52 (unimplemented shmsys)", /* 52 = unimplemented shmsys */ -#endif -#ifdef SYSVSEM - "semsys", /* 53 = semsys */ -#else - "#53 (unimplemented semsys)", /* 53 = unimplemented semsys */ -#endif - "ioctl", /* 54 = ioctl */ - "uadmin", /* 55 = uadmin */ - "#56 (unimplemented)", /* 56 = unimplemented */ - "utssys", /* 57 = utssys */ - "#58 (unimplemented)", /* 58 = unimplemented */ - "execve", /* 59 = execve */ - "umask", /* 60 = umask */ - "chroot", /* 61 = chroot */ - "fcntl", /* 62 = fcntl */ - "ulimit", /* 63 = ulimit */ - "#64 (unimplemented reserved for unix/pc)", /* 64 = unimplemented reserved for unix/pc */ - "#65 (unimplemented reserved for unix/pc)", /* 65 = unimplemented reserved for unix/pc */ - "#66 (unimplemented reserved for unix/pc)", /* 66 = unimplemented reserved for unix/pc */ - "#67 (unimplemented reserved for unix/pc)", /* 67 = unimplemented reserved for unix/pc */ - "#68 (unimplemented reserved for unix/pc)", /* 68 = unimplemented reserved for unix/pc */ - "#69 (unimplemented reserved for unix/pc)", /* 69 = unimplemented reserved for unix/pc */ - "#70 (obsolete rfs_advfs)", /* 70 = obsolete rfs_advfs */ - "#71 (obsolete rfs_unadvfs)", /* 71 = obsolete rfs_unadvfs */ - "#72 (obsolete rfs_rmount)", /* 72 = obsolete rfs_rmount */ - "#73 (obsolete rfs_rumount)", /* 73 = obsolete rfs_rumount */ - "#74 (obsolete rfs_rfstart)", /* 74 = obsolete rfs_rfstart */ - "#75 (obsolete rfs_sigret)", /* 75 = obsolete rfs_sigret */ - "#76 (obsolete rfs_rdebug)", /* 76 = obsolete rfs_rdebug */ - "#77 (obsolete rfs_rfstop)", /* 77 = obsolete rfs_rfstop */ - "#78 (unimplemented rfs_rfsys)", /* 78 = unimplemented rfs_rfsys */ - "rmdir", /* 79 = rmdir */ - "mkdir", /* 80 = mkdir */ - "getdents", /* 81 = getdents */ - "#82 (unimplemented)", /* 82 = unimplemented */ - "#83 (unimplemented)", /* 83 = unimplemented */ - "sysfs", /* 84 = sysfs */ - "getmsg", /* 85 = getmsg */ - "putmsg", /* 86 = putmsg */ - "poll", /* 87 = poll */ - "#88 (unimplemented)", /* 88 = unimplemented */ - "#89 (unimplemented)", /* 89 = unimplemented */ - "symlink", /* 90 = symlink */ - "lstat", /* 91 = lstat */ - "readlink", /* 92 = readlink */ - "#93 (unimplemented)", /* 93 = unimplemented */ - "#94 (unimplemented)", /* 94 = unimplemented */ - "#95 (unimplemented)", /* 95 = unimplemented */ - "#96 (unimplemented)", /* 96 = unimplemented */ - "#97 (unimplemented)", /* 97 = unimplemented */ - "#98 (unimplemented)", /* 98 = unimplemented */ - "#99 (unimplemented)", /* 99 = unimplemented */ - "#100 (unimplemented)", /* 100 = unimplemented */ - "#101 (unimplemented)", /* 101 = unimplemented */ - "#102 (unimplemented)", /* 102 = unimplemented */ - "sigreturn", /* 103 = sigreturn */ - "#104 (unimplemented)", /* 104 = unimplemented */ - "#105 (unimplemented)", /* 105 = unimplemented */ - "#106 (unimplemented)", /* 106 = unimplemented */ - "#107 (unimplemented)", /* 107 = unimplemented */ - "#108 (unimplemented)", /* 108 = unimplemented */ - "#109 (unimplemented)", /* 109 = unimplemented */ - "#110 (unimplemented)", /* 110 = unimplemented */ - "#111 (unimplemented)", /* 111 = unimplemented */ - "#112 (unimplemented)", /* 112 = unimplemented */ - "#113 (unimplemented)", /* 113 = unimplemented */ - "#114 (unimplemented)", /* 114 = unimplemented */ - "#115 (unimplemented)", /* 115 = unimplemented */ - "#116 (unimplemented)", /* 116 = unimplemented */ - "#117 (unimplemented)", /* 117 = unimplemented */ - "#118 (unimplemented)", /* 118 = unimplemented */ - "#119 (unimplemented)", /* 119 = unimplemented */ - "#120 (unimplemented)", /* 120 = unimplemented */ - "#121 (unimplemented)", /* 121 = unimplemented */ - "#122 (unimplemented)", /* 122 = unimplemented */ - "#123 (unimplemented)", /* 123 = unimplemented */ - "#124 (unimplemented)", /* 124 = unimplemented */ - "#125 (unimplemented)", /* 125 = unimplemented */ - "#126 (unimplemented)", /* 126 = unimplemented */ - "#127 (unimplemented)", /* 127 = unimplemented */ - "#128 (unimplemented)", /* 128 = unimplemented */ - "#129 (unimplemented xenix_xlocking)", /* 129 = unimplemented xenix_xlocking */ - "#130 (unimplemented xenix_creatsem)", /* 130 = unimplemented xenix_creatsem */ - "#131 (unimplemented xenix_opensem)", /* 131 = unimplemented xenix_opensem */ - "#132 (unimplemented xenix_sigsem)", /* 132 = unimplemented xenix_sigsem */ - "#133 (unimplemented xenix_waitsem)", /* 133 = unimplemented xenix_waitsem */ - "#134 (unimplemented xenix_nbwaitsem)", /* 134 = unimplemented xenix_nbwaitsem */ - "rdchk", /* 135 = rdchk */ - "#136 (unimplemented)", /* 136 = unimplemented */ - "#137 (unimplemented)", /* 137 = unimplemented */ - "chsize", /* 138 = chsize */ - "ftime", /* 139 = ftime */ - "nap", /* 140 = nap */ - "#141 (unimplemented xenix_sdget)", /* 141 = unimplemented xenix_sdget */ - "#142 (unimplemented xenix_sdfree)", /* 142 = unimplemented xenix_sdfree */ - "#143 (unimplemented xenix_sdenter)", /* 143 = unimplemented xenix_sdenter */ - "#144 (unimplemented xenix_sdleave)", /* 144 = unimplemented xenix_sdleave */ - "#145 (unimplemented xenix_sdgetv)", /* 145 = unimplemented xenix_sdgetv */ - "#146 (unimplemented xenix_sdwaitv)", /* 146 = unimplemented xenix_sdwaitv */ - "#147 (unimplemented)", /* 147 = unimplemented */ - "#148 (unimplemented)", /* 148 = unimplemented */ - "#149 (unimplemented)", /* 149 = unimplemented */ - "#150 (unimplemented)", /* 150 = unimplemented */ - "#151 (unimplemented)", /* 151 = unimplemented */ - "#152 (unimplemented)", /* 152 = unimplemented */ - "#153 (unimplemented)", /* 153 = unimplemented */ - "#154 (unimplemented)", /* 154 = unimplemented */ - "#155 (unimplemented)", /* 155 = unimplemented */ - "#156 (unimplemented)", /* 156 = unimplemented */ - "#157 (unimplemented)", /* 157 = unimplemented */ - "#158 (unimplemented)", /* 158 = unimplemented */ - "#159 (unimplemented)", /* 159 = unimplemented */ - "#160 (unimplemented xenix_proctl)", /* 160 = unimplemented xenix_proctl */ - "#161 (unimplemented xenix_execseg)", /* 161 = unimplemented xenix_execseg */ - "#162 (unimplemented xenix_unexecseg)", /* 162 = unimplemented xenix_unexecseg */ - "#163 (unimplemented)", /* 163 = unimplemented */ - "select", /* 164 = select */ - "eaccess", /* 165 = eaccess */ - "#166 (unimplemented xenix_paccess)", /* 166 = unimplemented xenix_paccess */ - "sigaction", /* 167 = sigaction */ - "sigprocmask", /* 168 = sigprocmask */ - "sigpending", /* 169 = sigpending */ - "sigsuspend", /* 170 = sigsuspend */ - "getgroups", /* 171 = getgroups */ - "setgroups", /* 172 = setgroups */ - "sysconf", /* 173 = sysconf */ - "pathconf", /* 174 = pathconf */ - "fpathconf", /* 175 = fpathconf */ - "rename", /* 176 = rename */ -}; diff --git a/sys/compat/ibcs2/ibcs2_sysent.c b/sys/compat/ibcs2/ibcs2_sysent.c deleted file mode 100644 index da39c160487..00000000000 --- a/sys/compat/ibcs2/ibcs2_sysent.c +++ /dev/null @@ -1,394 +0,0 @@ -/* $OpenBSD: ibcs2_sysent.c,v 1.10 2007/11/27 18:05:59 art Exp $ */ - -/* - * System call switch table. - * - * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.8 2002/03/14 03:16:03 millert Exp - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/signal.h> -#include <sys/mount.h> -#include <sys/poll.h> -#include <sys/syscallargs.h> -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_syscallargs.h> -#include <compat/ibcs2/ibcs2_statfs.h> - -#define s(type) sizeof(type) - -struct sysent ibcs2_sysent[] = { - { 0, 0, 0, - sys_nosys }, /* 0 = syscall */ - { 1, s(struct sys_exit_args), 0, - sys_exit }, /* 1 = exit */ - { 0, 0, 0, - sys_fork }, /* 2 = fork */ - { 3, s(struct ibcs2_sys_read_args), 0, - ibcs2_sys_read }, /* 3 = read */ - { 3, s(struct sys_write_args), 0, - sys_write }, /* 4 = write */ - { 3, s(struct ibcs2_sys_open_args), 0, - ibcs2_sys_open }, /* 5 = open */ - { 1, s(struct sys_close_args), 0, - sys_close }, /* 6 = close */ - { 3, s(struct ibcs2_sys_waitsys_args), 0, - ibcs2_sys_waitsys }, /* 7 = waitsys */ - { 2, s(struct ibcs2_sys_creat_args), 0, - ibcs2_sys_creat }, /* 8 = creat */ - { 2, s(struct sys_link_args), 0, - sys_link }, /* 9 = link */ - { 1, s(struct ibcs2_sys_unlink_args), 0, - ibcs2_sys_unlink }, /* 10 = unlink */ - { 2, s(struct ibcs2_sys_execv_args), 0, - ibcs2_sys_execv }, /* 11 = execv */ - { 1, s(struct ibcs2_sys_chdir_args), 0, - ibcs2_sys_chdir }, /* 12 = chdir */ - { 1, s(struct ibcs2_sys_time_args), 0, - ibcs2_sys_time }, /* 13 = time */ - { 3, s(struct ibcs2_sys_mknod_args), 0, - ibcs2_sys_mknod }, /* 14 = mknod */ - { 2, s(struct ibcs2_sys_chmod_args), 0, - ibcs2_sys_chmod }, /* 15 = chmod */ - { 3, s(struct ibcs2_sys_chown_args), 0, - ibcs2_sys_chown }, /* 16 = chown */ - { 1, s(struct sys_obreak_args), 0, - sys_obreak }, /* 17 = obreak */ - { 2, s(struct ibcs2_sys_stat_args), 0, - ibcs2_sys_stat }, /* 18 = stat */ - { 3, s(struct compat_43_sys_lseek_args), 0, - compat_43_sys_lseek }, /* 19 = lseek */ - { 0, 0, 0, - sys_getpid }, /* 20 = getpid */ - { 6, s(struct ibcs2_sys_mount_args), 0, - ibcs2_sys_mount }, /* 21 = mount */ - { 1, s(struct ibcs2_sys_umount_args), 0, - ibcs2_sys_umount }, /* 22 = umount */ - { 1, s(struct ibcs2_sys_setuid_args), 0, - ibcs2_sys_setuid }, /* 23 = setuid */ - { 0, 0, 0, - sys_getuid }, /* 24 = getuid */ - { 1, s(struct ibcs2_sys_stime_args), 0, - ibcs2_sys_stime }, /* 25 = stime */ - { 0, 0, 0, - sys_nosys }, /* 26 = unimplemented ibcs2_ptrace */ - { 1, s(struct ibcs2_sys_alarm_args), 0, - ibcs2_sys_alarm }, /* 27 = alarm */ - { 2, s(struct ibcs2_sys_fstat_args), 0, - ibcs2_sys_fstat }, /* 28 = fstat */ - { 0, 0, 0, - ibcs2_sys_pause }, /* 29 = pause */ - { 2, s(struct ibcs2_sys_utime_args), 0, - ibcs2_sys_utime }, /* 30 = utime */ - { 0, 0, 0, - sys_nosys }, /* 31 = unimplemented was stty */ - { 0, 0, 0, - sys_nosys }, /* 32 = unimplemented was gtty */ - { 2, s(struct ibcs2_sys_access_args), 0, - ibcs2_sys_access }, /* 33 = access */ - { 1, s(struct ibcs2_sys_nice_args), 0, - ibcs2_sys_nice }, /* 34 = nice */ - { 4, s(struct ibcs2_sys_statfs_args), 0, - ibcs2_sys_statfs }, /* 35 = statfs */ - { 0, 0, 0, - sys_sync }, /* 36 = sync */ - { 2, s(struct ibcs2_sys_kill_args), 0, - ibcs2_sys_kill }, /* 37 = kill */ - { 4, s(struct ibcs2_sys_fstatfs_args), 0, - ibcs2_sys_fstatfs }, /* 38 = fstatfs */ - { 4, s(struct ibcs2_sys_pgrpsys_args), 0, - ibcs2_sys_pgrpsys }, /* 39 = pgrpsys */ - { 0, 0, 0, - sys_nosys }, /* 40 = unimplemented ibcs2_xenix */ - { 1, s(struct sys_dup_args), 0, - sys_dup }, /* 41 = dup */ - { 0, 0, 0, - sys_opipe }, /* 42 = opipe */ - { 1, s(struct ibcs2_sys_times_args), 0, - ibcs2_sys_times }, /* 43 = times */ - { 0, 0, 0, - sys_nosys }, /* 44 = unimplemented profil */ - { 1, s(struct ibcs2_sys_plock_args), 0, - ibcs2_sys_plock }, /* 45 = plock */ - { 1, s(struct ibcs2_sys_setgid_args), 0, - ibcs2_sys_setgid }, /* 46 = setgid */ - { 0, 0, 0, - sys_getgid }, /* 47 = getgid */ - { 2, s(struct ibcs2_sys_sigsys_args), 0, - ibcs2_sys_sigsys }, /* 48 = sigsys */ -#ifdef SYSVMSG - { 6, s(struct ibcs2_sys_msgsys_args), 0, - ibcs2_sys_msgsys }, /* 49 = msgsys */ -#else - { 0, 0, 0, - sys_nosys }, /* 49 = unimplemented msgsys */ -#endif - { 2, s(struct ibcs2_sys_sysi86_args), 0, - ibcs2_sys_sysi86 }, /* 50 = sysi86 */ - { 0, 0, 0, - sys_nosys }, /* 51 = unimplemented ibcs2_acct */ -#ifdef SYSVSHM - { 4, s(struct ibcs2_sys_shmsys_args), 0, - ibcs2_sys_shmsys }, /* 52 = shmsys */ -#else - { 0, 0, 0, - sys_nosys }, /* 52 = unimplemented shmsys */ -#endif -#ifdef SYSVSEM - { 5, s(struct ibcs2_sys_semsys_args), 0, - ibcs2_sys_semsys }, /* 53 = semsys */ -#else - { 0, 0, 0, - sys_nosys }, /* 53 = unimplemented semsys */ -#endif - { 3, s(struct ibcs2_sys_ioctl_args), 0, - ibcs2_sys_ioctl }, /* 54 = ioctl */ - { 3, s(struct ibcs2_sys_uadmin_args), 0, - ibcs2_sys_uadmin }, /* 55 = uadmin */ - { 0, 0, 0, - sys_nosys }, /* 56 = unimplemented */ - { 3, s(struct ibcs2_sys_utssys_args), 0, - ibcs2_sys_utssys }, /* 57 = utssys */ - { 0, 0, 0, - sys_nosys }, /* 58 = unimplemented */ - { 3, s(struct ibcs2_sys_execve_args), 0, - ibcs2_sys_execve }, /* 59 = execve */ - { 1, s(struct sys_umask_args), 0, - sys_umask }, /* 60 = umask */ - { 1, s(struct sys_chroot_args), 0, - sys_chroot }, /* 61 = chroot */ - { 3, s(struct ibcs2_sys_fcntl_args), 0, - ibcs2_sys_fcntl }, /* 62 = fcntl */ - { 2, s(struct ibcs2_sys_ulimit_args), 0, - ibcs2_sys_ulimit }, /* 63 = ulimit */ - { 0, 0, 0, - sys_nosys }, /* 64 = unimplemented reserved for unix/pc */ - { 0, 0, 0, - sys_nosys }, /* 65 = unimplemented reserved for unix/pc */ - { 0, 0, 0, - sys_nosys }, /* 66 = unimplemented reserved for unix/pc */ - { 0, 0, 0, - sys_nosys }, /* 67 = unimplemented reserved for unix/pc */ - { 0, 0, 0, - sys_nosys }, /* 68 = unimplemented reserved for unix/pc */ - { 0, 0, 0, - sys_nosys }, /* 69 = unimplemented reserved for unix/pc */ - { 0, 0, 0, - sys_nosys }, /* 70 = obsolete rfs_advfs */ - { 0, 0, 0, - sys_nosys }, /* 71 = obsolete rfs_unadvfs */ - { 0, 0, 0, - sys_nosys }, /* 72 = obsolete rfs_rmount */ - { 0, 0, 0, - sys_nosys }, /* 73 = obsolete rfs_rumount */ - { 0, 0, 0, - sys_nosys }, /* 74 = obsolete rfs_rfstart */ - { 0, 0, 0, - sys_nosys }, /* 75 = obsolete rfs_sigret */ - { 0, 0, 0, - sys_nosys }, /* 76 = obsolete rfs_rdebug */ - { 0, 0, 0, - sys_nosys }, /* 77 = obsolete rfs_rfstop */ - { 0, 0, 0, - sys_nosys }, /* 78 = unimplemented rfs_rfsys */ - { 1, s(struct ibcs2_sys_rmdir_args), 0, - ibcs2_sys_rmdir }, /* 79 = rmdir */ - { 2, s(struct ibcs2_sys_mkdir_args), 0, - ibcs2_sys_mkdir }, /* 80 = mkdir */ - { 3, s(struct ibcs2_sys_getdents_args), 0, - ibcs2_sys_getdents }, /* 81 = getdents */ - { 0, 0, 0, - sys_nosys }, /* 82 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 83 = unimplemented */ - { 3, s(struct ibcs2_sys_sysfs_args), 0, - ibcs2_sys_sysfs }, /* 84 = sysfs */ - { 4, s(struct ibcs2_sys_getmsg_args), 0, - ibcs2_sys_getmsg }, /* 85 = getmsg */ - { 4, s(struct ibcs2_sys_putmsg_args), 0, - ibcs2_sys_putmsg }, /* 86 = putmsg */ - { 3, s(struct sys_poll_args), 0, - sys_poll }, /* 87 = poll */ - { 0, 0, 0, - sys_nosys }, /* 88 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 89 = unimplemented */ - { 2, s(struct ibcs2_sys_symlink_args), 0, - ibcs2_sys_symlink }, /* 90 = symlink */ - { 2, s(struct ibcs2_sys_lstat_args), 0, - ibcs2_sys_lstat }, /* 91 = lstat */ - { 3, s(struct ibcs2_sys_readlink_args), 0, - ibcs2_sys_readlink }, /* 92 = readlink */ - { 0, 0, 0, - sys_nosys }, /* 93 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 94 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 95 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 96 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 97 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 98 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 99 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 100 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 101 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 102 = unimplemented */ - { 1, s(struct sys_sigreturn_args), 0, - sys_sigreturn }, /* 103 = sigreturn */ - { 0, 0, 0, - sys_nosys }, /* 104 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 105 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 106 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 107 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 108 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 109 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 110 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 111 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 112 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 113 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 114 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 115 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 116 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 117 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 118 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 119 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 120 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 121 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 122 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 123 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 124 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 125 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 126 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 127 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 128 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 129 = unimplemented xenix_xlocking */ - { 0, 0, 0, - sys_nosys }, /* 130 = unimplemented xenix_creatsem */ - { 0, 0, 0, - sys_nosys }, /* 131 = unimplemented xenix_opensem */ - { 0, 0, 0, - sys_nosys }, /* 132 = unimplemented xenix_sigsem */ - { 0, 0, 0, - sys_nosys }, /* 133 = unimplemented xenix_waitsem */ - { 0, 0, 0, - sys_nosys }, /* 134 = unimplemented xenix_nbwaitsem */ - { 1, s(struct xenix_sys_rdchk_args), 0, - xenix_sys_rdchk }, /* 135 = rdchk */ - { 0, 0, 0, - sys_nosys }, /* 136 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 137 = unimplemented */ - { 2, s(struct xenix_sys_chsize_args), 0, - xenix_sys_chsize }, /* 138 = chsize */ - { 1, s(struct xenix_sys_ftime_args), 0, - xenix_sys_ftime }, /* 139 = ftime */ - { 1, s(struct xenix_sys_nap_args), 0, - xenix_sys_nap }, /* 140 = nap */ - { 0, 0, 0, - sys_nosys }, /* 141 = unimplemented xenix_sdget */ - { 0, 0, 0, - sys_nosys }, /* 142 = unimplemented xenix_sdfree */ - { 0, 0, 0, - sys_nosys }, /* 143 = unimplemented xenix_sdenter */ - { 0, 0, 0, - sys_nosys }, /* 144 = unimplemented xenix_sdleave */ - { 0, 0, 0, - sys_nosys }, /* 145 = unimplemented xenix_sdgetv */ - { 0, 0, 0, - sys_nosys }, /* 146 = unimplemented xenix_sdwaitv */ - { 0, 0, 0, - sys_nosys }, /* 147 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 148 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 149 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 150 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 151 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 152 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 153 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 154 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 155 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 156 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 157 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 158 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 159 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 160 = unimplemented xenix_proctl */ - { 0, 0, 0, - sys_nosys }, /* 161 = unimplemented xenix_execseg */ - { 0, 0, 0, - sys_nosys }, /* 162 = unimplemented xenix_unexecseg */ - { 0, 0, 0, - sys_nosys }, /* 163 = unimplemented */ - { 5, s(struct sys_select_args), 0, - sys_select }, /* 164 = select */ - { 2, s(struct ibcs2_sys_eaccess_args), 0, - ibcs2_sys_eaccess }, /* 165 = eaccess */ - { 0, 0, 0, - sys_nosys }, /* 166 = unimplemented xenix_paccess */ - { 3, s(struct ibcs2_sys_sigaction_args), 0, - ibcs2_sys_sigaction }, /* 167 = sigaction */ - { 3, s(struct ibcs2_sys_sigprocmask_args), 0, - ibcs2_sys_sigprocmask }, /* 168 = sigprocmask */ - { 1, s(struct ibcs2_sys_sigpending_args), 0, - ibcs2_sys_sigpending }, /* 169 = sigpending */ - { 1, s(struct ibcs2_sys_sigsuspend_args), 0, - ibcs2_sys_sigsuspend }, /* 170 = sigsuspend */ - { 2, s(struct ibcs2_sys_getgroups_args), 0, - ibcs2_sys_getgroups }, /* 171 = getgroups */ - { 2, s(struct ibcs2_sys_setgroups_args), 0, - ibcs2_sys_setgroups }, /* 172 = setgroups */ - { 1, s(struct ibcs2_sys_sysconf_args), 0, - ibcs2_sys_sysconf }, /* 173 = sysconf */ - { 2, s(struct ibcs2_sys_pathconf_args), 0, - ibcs2_sys_pathconf }, /* 174 = pathconf */ - { 2, s(struct ibcs2_sys_fpathconf_args), 0, - ibcs2_sys_fpathconf }, /* 175 = fpathconf */ - { 2, s(struct ibcs2_sys_rename_args), 0, - ibcs2_sys_rename }, /* 176 = rename */ -}; - diff --git a/sys/compat/ibcs2/ibcs2_sysi86.h b/sys/compat/ibcs2/ibcs2_sysi86.h deleted file mode 100644 index 91e46a8d9a9..00000000000 --- a/sys/compat/ibcs2/ibcs2_sysi86.h +++ /dev/null @@ -1,43 +0,0 @@ -/* $OpenBSD: ibcs2_sysi86.h,v 1.2 1996/08/02 20:35:14 niklas Exp $ */ -/* $NetBSD: ibcs2_sysi86.h,v 1.1 1996/01/06 03:23:54 scottb Exp $ */ - -/* - * Copyright (c) 1996 Scott Bartram - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_SYSI86_H -#define _IBCS2_SYSI86_H - -#define IBCS2_SI86FPHW 40 /* check floating-point support */ -#define IBCS2_SI86STIME 54 /* set system time */ -#define IBCS2_SI86SETNAME 56 /* set hostname */ -#define IBCS2_SI86PHYSMEM 65 /* get physical memory size */ - -/* from sys/fp.h */ -#define IBCS2_FP_NO 0 -#define IBCS2_FP_SW 1 -#define IBCS2_FP_HW 2 -#define IBCS2_FP_287 2 -#define IBCS2_FP_387 3 - -#endif /* _IBCS2_SYSI86_H */ diff --git a/sys/compat/ibcs2/ibcs2_termios.h b/sys/compat/ibcs2/ibcs2_termios.h deleted file mode 100644 index 0b9d1165efb..00000000000 --- a/sys/compat/ibcs2/ibcs2_termios.h +++ /dev/null @@ -1,236 +0,0 @@ -/* $OpenBSD: ibcs2_termios.h,v 1.2 1996/08/02 20:35:15 niklas Exp $ */ -/* $NetBSD: ibcs2_termios.h,v 1.3 1994/10/26 02:53:07 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_TERMIOS_H -#define _IBCS2_TERMIOS_H 1 - -#include <compat/ibcs2/ibcs2_types.h> - -#define IBCS2_NCC 8 -#define IBCS2_NCCS 13 - -typedef u_short ibcs2_tcflag_t; -typedef u_char ibcs2_cc_t; -typedef u_long ibcs2_speed_t; - -struct ibcs2_termio { - u_short c_iflag; - u_short c_oflag; - u_short c_cflag; - u_short c_lflag; - char c_line; - u_char c_cc[IBCS2_NCC]; -}; - -struct ibcs2_termios { - ibcs2_tcflag_t c_iflag; - ibcs2_tcflag_t c_oflag; - ibcs2_tcflag_t c_cflag; - ibcs2_tcflag_t c_lflag; - char c_line; - ibcs2_cc_t c_cc[IBCS2_NCCS]; - char c_ispeed; - char c_ospeed; -}; - -#define IBCS2_VINTR 0 -#define IBCS2_VQUIT 1 -#define IBCS2_VERASE 2 -#define IBCS2_VKILL 3 -#define IBCS2_VEOF 4 -#define IBCS2_VEOL 5 -#define IBCS2_VEOL2 6 -#define IBCS2_VMIN 4 -#define IBCS2_VTIME 5 -#define IBCS2_VSWTCH 7 -#define IBCS2_VSUSP 10 -#define IBCS2_VSTART 11 -#define IBCS2_VSTOP 12 - -#define IBCS2_CNUL 0 -#define IBCS2_CDEL 0377 -#define IBCS2_CESC '\\' -#define IBCS2_CINTR 0177 -#define IBCS2_CQUIT 034 -#define IBCS2_CERASE '#' -#define IBCS2_CKILL '@' -#define IBCS2_CSTART 021 -#define IBCS2_CSTOP 023 -#define IBCS2_CSWTCH 032 -#define IBCS2_CNSWTCH 0 -#define IBCS2_CSUSP 032 - -#define IBCS2_IGNBRK 0000001 -#define IBCS2_BRKINT 0000002 -#define IBCS2_IGNPAR 0000004 -#define IBCS2_PARMRK 0000010 -#define IBCS2_INPCK 0000020 -#define IBCS2_ISTRIP 0000040 -#define IBCS2_INLCR 0000100 -#define IBCS2_IGNCR 0000200 -#define IBCS2_ICRNL 0000400 -#define IBCS2_IUCLC 0001000 -#define IBCS2_IXON 0002000 -#define IBCS2_IXANY 0004000 -#define IBCS2_IXOFF 0010000 -#define IBCS2_IMAXBEL 0020000 -#define IBCS2_DOSMODE 0100000 - -#define IBCS2_OPOST 0000001 -#define IBCS2_OLCUC 0000002 -#define IBCS2_ONLCR 0000004 -#define IBCS2_OCRNL 0000010 -#define IBCS2_ONOCR 0000020 -#define IBCS2_ONLRET 0000040 -#define IBCS2_OFILL 0000100 -#define IBCS2_OFDEL 0000200 -#define IBCS2_NLDLY 0000400 -#define IBCS2_NL0 0000000 -#define IBCS2_NL1 0000400 -#define IBCS2_CRDLY 0003000 -#define IBCS2_CR0 0000000 -#define IBCS2_CR1 0001000 -#define IBCS2_CR2 0002000 -#define IBCS2_CR3 0003000 -#define IBCS2_TABDLY 0014000 -#define IBCS2_TAB0 0000000 -#define IBCS2_TAB1 0004000 -#define IBCS2_TAB2 0010000 -#define IBCS2_TAB3 0014000 -#define IBCS2_BSDLY 0020000 -#define IBCS2_BS0 0000000 -#define IBCS2_BS1 0020000 -#define IBCS2_VTDLY 0040000 -#define IBCS2_VT0 0000000 -#define IBCS2_VT1 0040000 -#define IBCS2_FFDLY 0100000 -#define IBCS2_FF0 0000000 -#define IBCS2_FF1 0100000 - -#define IBCS2_CBAUD 0000017 -#define IBCS2_CSIZE 0000060 -#define IBCS2_CS5 0000000 -#define IBCS2_CS6 0000020 -#define IBCS2_CS7 0000040 -#define IBCS2_CS8 0000060 -#define IBCS2_CSTOPB 0000100 -#define IBCS2_CREAD 0000200 -#define IBCS2_PARENB 0000400 -#define IBCS2_PARODD 0001000 -#define IBCS2_HUPCL 0002000 -#define IBCS2_CLOCAL 0004000 -#define IBCS2_RCV1EN 0010000 -#define IBCS2_XMT1EN 0020000 -#define IBCS2_LOBLK 0040000 -#define IBCS2_XCLUDE 0100000 - -#define IBCS2_ISIG 0000001 -#define IBCS2_ICANON 0000002 -#define IBCS2_XCASE 0000004 -#define IBCS2_ECHO 0000010 -#define IBCS2_ECHOE 0000020 -#define IBCS2_ECHOK 0000040 -#define IBCS2_ECHONL 0000100 -#define IBCS2_NOFLSH 0000200 -#define IBCS2_IEXTEN 0000400 -#define IBCS2_TOSTOP 0001000 - -#define IBCS2_XIOC (('i'<<24)|('X'<<16)) -#define IBCS2_XCGETA (IBCS2_XIOC|1) -#define IBCS2_XCSETA (IBCS2_XIOC|2) -#define IBCS2_XCSETAW (IBCS2_XIOC|3) -#define IBCS2_XCSETAF (IBCS2_XIOC|4) - -#define IBCS2_OXIOC ('x'<<8) -#define IBCS2_OXCGETA (IBCS2_OXIOC|1) -#define IBCS2_OXCSETA (IBCS2_OXIOC|2) -#define IBCS2_OXCSETAW (IBCS2_OXIOC|3) -#define IBCS2_OXCSETAF (IBCS2_OXIOC|4) - -#define IBCS2_TIOC ('T'<<8) -#define IBCS2_TCGETA (IBCS2_TIOC|1) -#define IBCS2_TCSETA (IBCS2_TIOC|2) -#define IBCS2_TCSETAW (IBCS2_TIOC|3) -#define IBCS2_TCSETAF (IBCS2_TIOC|4) -#define IBCS2_TCSBRK (IBCS2_TIOC|5) -#define IBCS2_TCXONC (IBCS2_TIOC|6) -#define IBCS2_TCFLSH (IBCS2_TIOC|7) - -#define IBCS2_TCGETSC (IBCS2_TIOC|34) -#define IBCS2_TCSETSC (IBCS2_TIOC|35) - -#define IBCS2_TIOCSWINSZ (IBCS2_TIOC|103) -#define IBCS2_TIOCGWINSZ (IBCS2_TIOC|104) -#define IBCS2_TIOCSPGRP (IBCS2_TIOC|118) -#define IBCS2_TIOCGPGRP (IBCS2_TIOC|119) - -#define IBCS2_TCSANOW IBCS2_XCSETA -#define IBCS2_TCSADRAIN IBCS2_XCSETAW -#define IBCS2_TCSAFLUSH IBCS2_XCSETAF -#define IBCS2_TCSADFLUSH IBCS2_XCSETAF - -#define IBCS2_TCIFLUSH 0 -#define IBCS2_TCOFLUSH 1 -#define IBCS2_TCIOFLUSH 2 - -#define IBCS2_TCOOFF 0 -#define IBCS2_TCOON 1 -#define IBCS2_TCIOFF 2 -#define IBCS2_TCION 3 - -#define IBCS2_B0 0 -#define IBCS2_B50 1 -#define IBCS2_B75 2 -#define IBCS2_B110 3 -#define IBCS2_B134 4 -#define IBCS2_B150 5 -#define IBCS2_B200 6 -#define IBCS2_B300 7 -#define IBCS2_B600 8 -#define IBCS2_B1200 9 -#define IBCS2_B1800 10 -#define IBCS2_B2400 11 -#define IBCS2_B4800 12 -#define IBCS2_B9600 13 -#define IBCS2_B19200 14 -#define IBCS2_B38400 15 - -struct ibcs2_winsize { - u_short ws_row; - u_short ws_col; - u_short ws_xpixel; - u_short ws_ypixel; -}; - -#endif /* _IBCS2_H_ */ - diff --git a/sys/compat/ibcs2/ibcs2_time.h b/sys/compat/ibcs2/ibcs2_time.h deleted file mode 100644 index 986ab059121..00000000000 --- a/sys/compat/ibcs2/ibcs2_time.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: ibcs2_time.h,v 1.2 1996/08/02 20:35:15 niklas Exp $ */ -/* $NetBSD: ibcs2_time.h,v 1.2 1994/10/26 02:53:08 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_TIME_H -#define _IBCS2_TIME_H - -#include <compat/ibcs2/ibcs2_types.h> - -struct ibcs2_tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; -}; - -#endif /* _IBCS2_TIME_H */ diff --git a/sys/compat/ibcs2/ibcs2_timeb.h b/sys/compat/ibcs2/ibcs2_timeb.h deleted file mode 100644 index 2f112ea6e96..00000000000 --- a/sys/compat/ibcs2/ibcs2_timeb.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $OpenBSD: ibcs2_timeb.h,v 1.6 2009/01/07 12:52:46 jsg Exp $ */ -/* $NetBSD: ibcs2_timeb.h,v 1.2 1996/05/03 17:05:34 christos Exp $ */ - -/* - * Copyright (c) 1995 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_TIMEB_H -#define _IBCS2_TIMEB_H - -struct xenix_timeb { - ibcs2_time_t time; - unsigned short millitm; - short timezone; - short dstflag; -} __packed; - -#define xenix_timeb_len 10 /* packed struct */ - -#endif /* _IBCS2_TIMEB_H */ diff --git a/sys/compat/ibcs2/ibcs2_types.h b/sys/compat/ibcs2/ibcs2_types.h deleted file mode 100644 index 9e947a92d59..00000000000 --- a/sys/compat/ibcs2/ibcs2_types.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $OpenBSD: ibcs2_types.h,v 1.3 2007/06/06 17:15:13 deraadt Exp $ */ -/* $NetBSD: ibcs2_types.h,v 1.5 1995/08/14 01:11:54 mycroft Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_TYPES_H -#define _IBCS2_TYPES_H - -typedef unsigned char ibcs2_uchar_t; -typedef unsigned long ibcs2_ulong_t; - -typedef char * ibcs2_caddr_t; -typedef int32_t ibcs2_daddr_t; -typedef long ibcs2_off_t; -typedef long ibcs2_key_t; -typedef unsigned short ibcs2_uid_t; -typedef unsigned short ibcs2_gid_t; -typedef short ibcs2_nlink_t; -typedef short ibcs2_dev_t; -typedef unsigned short ibcs2_ino_t; -typedef unsigned int ibcs2_size_t; -typedef long ibcs2_time_t; -typedef long ibcs2_clock_t; -typedef unsigned short ibcs2_mode_t; -typedef short ibcs2_pid_t; - -#endif /* _IBCS2_TYPES_H */ diff --git a/sys/compat/ibcs2/ibcs2_unistd.h b/sys/compat/ibcs2/ibcs2_unistd.h deleted file mode 100644 index 011dd594ea0..00000000000 --- a/sys/compat/ibcs2/ibcs2_unistd.h +++ /dev/null @@ -1,76 +0,0 @@ -/* $OpenBSD: ibcs2_unistd.h,v 1.2 1996/08/02 20:35:17 niklas Exp $ */ -/* $NetBSD: ibcs2_unistd.h,v 1.2 1994/10/26 02:53:11 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_UNISTD_H -#define _IBCS2_UNISTD_H - -#define IBCS2_R_OK 4 -#define IBCS2_W_OK 2 -#define IBCS2_X_OK 1 -#define IBCS2_F_OK 0 - -#define IBCS2_F_ULOCK 0 -#define IBCS2_F_LOCK 1 -#define IBCS2_F_TLOCK 2 -#define IBCS2_F_TEST 3 - -#define IBCS2_SEEK_SET 0 -#define IBCS2_SEEK_CUR 1 -#define IBCS2_SEEK_END 2 - -#define IBCS2_SC_ARG_MAX 0 -#define IBCS2_SC_CHILD_MAX 1 -#define IBCS2_SC_CLK_TCK 2 -#define IBCS2_SC_NGROUPS_MAX 3 -#define IBCS2_SC_OPEN_MAX 4 -#define IBCS2_SC_JOB_CONTROL 5 -#define IBCS2_SC_SAVED_IDS 6 -#define IBCS2_SC_VERSION 7 -#define IBCS2_SC_PASS_MAX 8 -#define IBCS2_SC_XOPEN_VERSION 9 - -#define IBCS2_PC_LINK_MAX 0 -#define IBCS2_PC_MAX_CANON 1 -#define IBCS2_PC_MAX_INPUT 2 -#define IBCS2_PC_NAME_MAX 3 -#define IBCS2_PC_PATH_MAX 4 -#define IBCS2_PC_PIPE_BUF 5 -#define IBCS2_PC_CHOWN_RESTRICTED 6 -#define IBCS2_PC_NO_TRUNC 7 -#define IBCS2_PC_VDISABLE 8 - -#define IBCS2_STDIN_FILENO 0 -#define IBCS2_STDOUT_FILENO 1 -#define IBCS2_STDERR_FILENO 2 - -#endif /* _IBCS2_UNISTD_H */ diff --git a/sys/compat/ibcs2/ibcs2_ustat.h b/sys/compat/ibcs2/ibcs2_ustat.h deleted file mode 100644 index 53534b2e9b4..00000000000 --- a/sys/compat/ibcs2/ibcs2_ustat.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenBSD: ibcs2_ustat.h,v 1.2 1996/08/02 20:35:17 niklas Exp $ */ -/* $NetBSD: ibcs2_ustat.h,v 1.2 1994/10/26 02:53:13 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_USTAT_H -#define _IBCS2_USTAT_H 1 - -#include <compat/ibcs2/ibcs2_types.h> - -struct ibcs2_ustat { - long f_tfree; - ibcs2_ino_t f_tinode; - char f_fname[6]; - char f_fpack[6]; -}; -#define ibcs2_ustat_len (sizeof(struct ibcs2_ustat)) - -#endif /* _IBCS2_USTAT_H */ diff --git a/sys/compat/ibcs2/ibcs2_util.h b/sys/compat/ibcs2/ibcs2_util.h deleted file mode 100644 index 7ac809a43b8..00000000000 --- a/sys/compat/ibcs2/ibcs2_util.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $OpenBSD: ibcs2_util.h,v 1.3 1997/01/23 16:12:20 niklas Exp $ */ -/* $NetBSD: ibcs2_util.h,v 1.4 1996/10/13 00:46:52 christos Exp $ */ - -/* - * Copyright (c) 1994 Christos Zoulas - * Copyright (c) 1995 Frank van der Linden - * Copyright (c) 1995 Scott Bartram - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - * - */ - -#ifndef _IBCS2_UTIL_H_ -#define _IBCS2_UTIL_H_ - -#include <compat/common/compat_util.h> - -#ifdef DEBUG_IBCS2 -#define DPRINTF(a) printf a; -#else -#define DPRINTF(a) -#endif - -extern const char ibcs2_emul_path[]; - -#define IBCS2_CHECK_ALT_EXIST(p, sgp, path) \ - CHECK_ALT_EXIST(p, sgp, ibcs2_emul_path, path) - -#define IBCS2_CHECK_ALT_CREAT(p, sgp, path) \ - CHECK_ALT_CREAT(p, sgp, ibcs2_emul_path, path) - -#endif /* !_IBCS2_UTIL_H_ */ diff --git a/sys/compat/ibcs2/ibcs2_utime.h b/sys/compat/ibcs2/ibcs2_utime.h deleted file mode 100644 index 27a1240a77c..00000000000 --- a/sys/compat/ibcs2/ibcs2_utime.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $OpenBSD: ibcs2_utime.h,v 1.3 1996/08/02 20:35:18 niklas Exp $ */ -/* $NetBSD: ibcs2_utime.h,v 1.2 1996/05/03 17:05:35 christos Exp $ */ - -/* - * Copyright (c) 1995 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_UTIME_H -#define _IBCS2_UTIME_H - -#include <compat/ibcs2/ibcs2_types.h> - -struct ibcs2_utimbuf { - ibcs2_time_t actime; - ibcs2_time_t modtime; -}; - -#endif /* _IBCS2_UTIME_H */ diff --git a/sys/compat/ibcs2/ibcs2_utsname.h b/sys/compat/ibcs2/ibcs2_utsname.h deleted file mode 100644 index 118cd3e769c..00000000000 --- a/sys/compat/ibcs2/ibcs2_utsname.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $OpenBSD: ibcs2_utsname.h,v 1.2 1996/08/02 20:35:19 niklas Exp $ */ -/* $NetBSD: ibcs2_utsname.h,v 1.2 1994/10/26 02:53:14 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_UTSNAME_H -#define _IBCS2_UTSNAME_H - -struct ibcs2_utsname { - char sysname[9]; - char nodename[9]; - char release[9]; - char version[9]; - char machine[9]; -}; -#define ibcs2_utsname_len (sizeof(struct ibcs2_utsname)) - -#endif /* _IBCS2_UTSNAME_H */ diff --git a/sys/compat/ibcs2/ibcs2_wait.h b/sys/compat/ibcs2/ibcs2_wait.h deleted file mode 100644 index 05b9514d389..00000000000 --- a/sys/compat/ibcs2/ibcs2_wait.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $OpenBSD: ibcs2_wait.h,v 1.2 1996/08/02 20:35:19 niklas Exp $ */ -/* $NetBSD: ibcs2_wait.h,v 1.2 1994/10/26 02:53:16 cgd Exp $ */ - -/* - * Copyright (c) 1994 Scott Bartram - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 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. - */ - -#ifndef _IBCS2_WAIT_H -#define _IBCS2_WAIT_H - -#define IBCS2_WUNTRACED 0x02 -#define IBCS2_WNOHANG 0x01 - -#define IBCS2_WIFEXITED(stat) ((stat & 0xff) == 0) -#define IBCS2_WIFSIGNALED(stat) ((stat) && (stat == (stat & 0xff))) -#define IBCS2_WIFSTOPPED(stat) ((stat & 0xff) == 0x7f) - -#define IBCS2_WEXITSTATUS(stat) ((stat >> 8) & 0xff) -#define IBCS2_WTERMSIG(stat) (stat & 0x7f) -#define IBCS2_WSTOPSIG(stat) ((stat >> 8) & 0xff) - -#endif /* _IBCS2_WAIT_H */ diff --git a/sys/compat/ibcs2/syscalls.conf b/sys/compat/ibcs2/syscalls.conf deleted file mode 100644 index 4160096a357..00000000000 --- a/sys/compat/ibcs2/syscalls.conf +++ /dev/null @@ -1,13 +0,0 @@ -# $OpenBSD: syscalls.conf,v 1.3 2001/05/16 05:02:20 millert Exp $ - -# syscalls.conf - -sysnames="ibcs2_syscalls.c" -sysnumhdr="ibcs2_syscall.h" -syssw="ibcs2_sysent.c" -sysarghdr="ibcs2_syscallargs.h" -libcompatopts="" - -switchname="ibcs2_sysent" -namesname="ibcs2_syscallnames" -constprefix="IBCS2_SYS_" diff --git a/sys/compat/ibcs2/syscalls.master b/sys/compat/ibcs2/syscalls.master deleted file mode 100644 index 35b75efbe68..00000000000 --- a/sys/compat/ibcs2/syscalls.master +++ /dev/null @@ -1,261 +0,0 @@ - $OpenBSD: syscalls.master,v 1.8 2002/03/14 03:16:03 millert Exp $ -; $NetBSD: syscalls.master,v 1.10 1996/09/07 14:21:59 mycroft Exp $ - -; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 - -; NetBSD COMPAT_IBCS2 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 STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of -; the compatibility options defined in syscalls.conf. -; -; types: -; STD always included -; OBSOL obsolete, not included in system -; 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 -; -; The compat options are defined in the syscalls.conf file, and the -; compat option name is prefixed to the syscall name. Other than -; that, they're like NODEF (for 'compat' options), or STD (for -; 'libcompat' options). -; -; The type-dependent arguments are as follows: -; For STD, NODEF, NOARGS, and compat syscalls: -; { pseudo-proto } [alias] -; For other syscalls: -; [comment] -; -; #ifdef's, etc. may be included, and are copied to the output files. -; #include's are copied to the syscall switch definition file only. - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/signal.h> -#include <sys/mount.h> -#include <sys/poll.h> -#include <sys/syscallargs.h> - -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_syscallargs.h> -#include <compat/ibcs2/ibcs2_statfs.h> - -0 NOARGS { int sys_nosys(void); } syscall -1 NOARGS { int sys_exit(int rval); } -2 NOARGS { int sys_fork(void); } -3 STD { int ibcs2_sys_read(int fd, char *buf, u_int nbytes); } -4 NOARGS { int sys_write(int fd, char *buf, u_int nbytes); } -5 STD { int ibcs2_sys_open(char *path, int flags, int mode); } -6 NOARGS { int sys_close(int fd); } -7 STD { int ibcs2_sys_waitsys(int a1, int a2, int a3); } -8 STD { int ibcs2_sys_creat(char *path, int mode); } -9 NOARGS { int sys_link(char *path, char *link); } -10 STD { int ibcs2_sys_unlink(char *path); } -11 STD { int ibcs2_sys_execv(char *path, char **argp); } -12 STD { int ibcs2_sys_chdir(char *path); } -13 STD { int ibcs2_sys_time(ibcs2_time_t *tp); } -14 STD { int ibcs2_sys_mknod(char *path, int mode, int dev); } -15 STD { int ibcs2_sys_chmod(char *path, int mode); } -16 STD { int ibcs2_sys_chown(char *path, int uid, int gid); } -17 NOARGS { int sys_obreak(caddr_t nsize); } -18 STD { int ibcs2_sys_stat(char *path, \ - struct ibcs2_stat *st); } -19 NOARGS { long compat_43_sys_lseek(int fd, long offset, \ - int whence); } -20 NOARGS { pid_t sys_getpid(void); } -21 STD { int ibcs2_sys_mount(char *special, char *dir, \ - int flags, int fstype, char *data, int len); } -22 STD { int ibcs2_sys_umount(char *name); } -23 STD { int ibcs2_sys_setuid(int uid); } -24 NOARGS { uid_t sys_getuid(void); } -25 STD { int ibcs2_sys_stime(long *timep); } -26 UNIMPL ibcs2_ptrace -27 STD { int ibcs2_sys_alarm(unsigned sec); } -28 STD { int ibcs2_sys_fstat(int fd, struct ibcs2_stat *st); } -29 STD { int ibcs2_sys_pause(void); } -30 STD { int ibcs2_sys_utime(char *path, \ - struct ibcs2_utimbuf *buf); } -31 UNIMPL was stty -32 UNIMPL was gtty -33 STD { int ibcs2_sys_access(char *path, int flags); } -34 STD { int ibcs2_sys_nice(int incr); } -35 STD { int ibcs2_sys_statfs(char *path, \ - struct ibcs2_statfs *buf, int len, int fstype); } -36 NOARGS { int sys_sync(void); } -37 STD { int ibcs2_sys_kill(int pid, int signo); } -38 STD { int ibcs2_sys_fstatfs(int fd, \ - struct ibcs2_statfs *buf, int len, int fstype); } -39 STD { int ibcs2_sys_pgrpsys(int type, caddr_t dummy, \ - int pid, int pgid); } -40 UNIMPL ibcs2_xenix -41 NOARGS { int sys_dup(u_int fd); } -42 NOARGS { int sys_opipe(void); } -43 STD { int ibcs2_sys_times(struct tms *tp); } -44 UNIMPL profil -45 STD { int ibcs2_sys_plock(int cmd); } -46 STD { int ibcs2_sys_setgid(int gid); } -47 NOARGS { gid_t sys_getgid(void); } -48 STD { int ibcs2_sys_sigsys(int sig, ibcs2_sig_t fp); } -#ifdef SYSVMSG -49 STD { int ibcs2_sys_msgsys(int which, int a2, int a3, \ - int a4, int a5, int a6); } -#else -49 UNIMPL msgsys -#endif -50 STD { int ibcs2_sys_sysi86(int cmd, int arg); } -51 UNIMPL ibcs2_acct -#ifdef SYSVSHM -52 STD { int ibcs2_sys_shmsys(int which, int a2, int a3, \ - int a4); } -#else -52 UNIMPL shmsys -#endif -#ifdef SYSVSEM -53 STD { int ibcs2_sys_semsys(int which, int a2, int a3, \ - int a4, int a5); } -#else -53 UNIMPL semsys -#endif -54 STD { int ibcs2_sys_ioctl(int fd, int cmd, caddr_t data); } -55 STD { int ibcs2_sys_uadmin(int cmd, int func, \ - caddr_t data); } -56 UNIMPL -57 STD { int ibcs2_sys_utssys(int a1, int a2, int flag); } -58 UNIMPL -59 STD { int ibcs2_sys_execve(char *path, char **argp, \ - char **envp); } -60 NOARGS { int sys_umask(int newmask); } -61 NOARGS { int sys_chroot(char *path); } -62 STD { int ibcs2_sys_fcntl(int fd, int cmd, char *arg); } -63 STD { long ibcs2_sys_ulimit(int cmd, int newlimit); } -64 UNIMPL reserved for unix/pc -65 UNIMPL reserved for unix/pc -66 UNIMPL reserved for unix/pc -67 UNIMPL reserved for unix/pc -68 UNIMPL reserved for unix/pc -69 UNIMPL reserved for unix/pc -70 OBSOL rfs_advfs -71 OBSOL rfs_unadvfs -72 OBSOL rfs_rmount -73 OBSOL rfs_rumount -74 OBSOL rfs_rfstart -75 OBSOL rfs_sigret -76 OBSOL rfs_rdebug -77 OBSOL rfs_rfstop -78 UNIMPL rfs_rfsys -79 STD { int ibcs2_sys_rmdir(char *path); } -80 STD { int ibcs2_sys_mkdir(char *path, int mode); } -81 STD { int ibcs2_sys_getdents(int fd, char *buf, \ - int nbytes); } -82 UNIMPL -83 UNIMPL -84 STD { int ibcs2_sys_sysfs(int cmd, caddr_t d1, char *buf); } -85 STD { int ibcs2_sys_getmsg(int fd, \ - struct ibcs2_stropts *ctl, \ - struct ibcs2_stropts *dat, int *flags); } -86 STD { int ibcs2_sys_putmsg(int fd, \ - struct ibcs2_stropts *ctl, \ - struct ibcs2_stropts *dat, int flags); } -87 NOARGS { int sys_poll(struct pollfd *fds, u_long nfds, \ - int timeout); } -88 UNIMPL -89 UNIMPL -90 STD { int ibcs2_sys_symlink(char *path, char *link); } -91 STD { int ibcs2_sys_lstat(char *path, \ - struct ibcs2_stat *st); } -92 STD { int ibcs2_sys_readlink(char *path, char *buf, \ - int count); } -93 UNIMPL -94 UNIMPL -95 UNIMPL -96 UNIMPL -97 UNIMPL -98 UNIMPL -99 UNIMPL -100 UNIMPL -101 UNIMPL -102 UNIMPL -103 NOARGS { int sys_sigreturn(struct sigcontext *sigcntxp); } -104 UNIMPL -105 UNIMPL -106 UNIMPL -107 UNIMPL -108 UNIMPL -109 UNIMPL -110 UNIMPL -111 UNIMPL -112 UNIMPL -113 UNIMPL -114 UNIMPL -115 UNIMPL -116 UNIMPL -117 UNIMPL -118 UNIMPL -119 UNIMPL -120 UNIMPL -121 UNIMPL -122 UNIMPL -123 UNIMPL -124 UNIMPL -125 UNIMPL -126 UNIMPL -127 UNIMPL -128 UNIMPL -129 UNIMPL xenix_xlocking -130 UNIMPL xenix_creatsem -131 UNIMPL xenix_opensem -132 UNIMPL xenix_sigsem -133 UNIMPL xenix_waitsem -134 UNIMPL xenix_nbwaitsem -135 STD { int xenix_sys_rdchk(int fd); } -136 UNIMPL -137 UNIMPL -138 STD { int xenix_sys_chsize(int fd, long size); } -139 STD { int xenix_sys_ftime(struct xenix_timeb *tp); } -140 STD { int xenix_sys_nap(int millisec); } -141 UNIMPL xenix_sdget -142 UNIMPL xenix_sdfree -143 UNIMPL xenix_sdenter -144 UNIMPL xenix_sdleave -145 UNIMPL xenix_sdgetv -146 UNIMPL xenix_sdwaitv -147 UNIMPL -148 UNIMPL -149 UNIMPL -150 UNIMPL -151 UNIMPL -152 UNIMPL -153 UNIMPL -154 UNIMPL -155 UNIMPL -156 UNIMPL -157 UNIMPL -158 UNIMPL -159 UNIMPL -160 UNIMPL xenix_proctl -161 UNIMPL xenix_execseg -162 UNIMPL xenix_unexecseg -163 UNIMPL -164 NOARGS { int sys_select(u_int nd, fd_set *in, fd_set *ou, \ - fd_set *ex, struct timeval *tv); } -165 STD { int ibcs2_sys_eaccess(char *path, int flags); } -166 UNIMPL xenix_paccess -167 STD { int ibcs2_sys_sigaction(int signum, \ - struct ibcs2_sigaction *nsa, \ - struct ibcs2_sigaction *osa); } -168 STD { int ibcs2_sys_sigprocmask(int how, \ - ibcs2_sigset_t *set, ibcs2_sigset_t *oset); } -169 STD { int ibcs2_sys_sigpending(ibcs2_sigset_t *mask); } -170 STD { int ibcs2_sys_sigsuspend(ibcs2_sigset_t *mask); } -171 STD { int ibcs2_sys_getgroups(int gidsetsize, \ - ibcs2_gid_t *gidset); } -172 STD { int ibcs2_sys_setgroups(int gidsetsize, \ - ibcs2_gid_t *gidset); } -173 STD { int ibcs2_sys_sysconf(int name); } -174 STD { int ibcs2_sys_pathconf(char *path, int name); } -175 STD { int ibcs2_sys_fpathconf(int fd, int name); } -176 STD { int ibcs2_sys_rename(char *from, char *to); } |