diff options
author | 2010-07-02 19:57:53 +0000 | |
---|---|---|
committer | 2010-07-02 19:57:53 +0000 | |
commit | 75a48e89bfe56add682a15a3edb43edbeaa8a561 (patch) | |
tree | 9fe90e33272f10ab6dd0b26ef57d8d9809e2fb96 | |
parent | remove support for compat_sunos (and m68k4k). ok deraadt guenther (diff) | |
download | wireguard-openbsd-75a48e89bfe56add682a15a3edb43edbeaa8a561.tar.xz wireguard-openbsd-75a48e89bfe56add682a15a3edb43edbeaa8a561.zip |
remove sunos compat files
-rw-r--r-- | sys/compat/m68k4k/files.m68k4k | 7 | ||||
-rw-r--r-- | sys/compat/m68k4k/m68k4k_exec.c | 256 | ||||
-rw-r--r-- | sys/compat/m68k4k/m68k4k_exec.h | 41 | ||||
-rw-r--r-- | sys/compat/sunos/Makefile | 8 | ||||
-rw-r--r-- | sys/compat/sunos/files.sunos | 14 | ||||
-rw-r--r-- | sys/compat/sunos/sunos.h | 151 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_dirent.h | 47 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_exec.c | 269 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_exec.h | 47 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_ioctl.c | 1051 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_misc.c | 1212 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_syscall.h | 447 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_syscallargs.h | 393 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_syscalls.c | 230 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_sysent.c | 440 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_util.h | 42 | ||||
-rw-r--r-- | sys/compat/sunos/syscalls.conf | 12 | ||||
-rw-r--r-- | sys/compat/sunos/syscalls.master | 314 |
18 files changed, 0 insertions, 4981 deletions
diff --git a/sys/compat/m68k4k/files.m68k4k b/sys/compat/m68k4k/files.m68k4k deleted file mode 100644 index 87a272ed9cf..00000000000 --- a/sys/compat/m68k4k/files.m68k4k +++ /dev/null @@ -1,7 +0,0 @@ -# $OpenBSD: files.m68k4k,v 1.1 1997/01/13 11:07:51 niklas Exp $ -# $NetBSD: files.m68k4k,v 1.1 1996/09/10 22:01:20 thorpej Exp $ -# -# Config.new file description for m68k4k compat code. Included by -# sys/arch/m68k/conf/files.m68k - -file compat/m68k4k/m68k4k_exec.c compat_m68k4k diff --git a/sys/compat/m68k4k/m68k4k_exec.c b/sys/compat/m68k4k/m68k4k_exec.c deleted file mode 100644 index b074ecb63e1..00000000000 --- a/sys/compat/m68k4k/m68k4k_exec.c +++ /dev/null @@ -1,256 +0,0 @@ -/* $OpenBSD: m68k4k_exec.c,v 1.6 2002/03/14 01:26:50 millert Exp $ */ -/* $NetBSD: m68k4k_exec.c,v 1.1 1996/09/10 22:01:20 thorpej Exp $ */ - -/* - * Copyright (c) 1993, 1994 Christopher G. Demetriou - * 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 Christopher G. Demetriou. - * 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. - */ - -/* - * Exec glue to provide compatibility with older {Net,Open}BSD m68k4k - * exectuables. - * - * Taken directly from kern/exec_aout.c and frobbed to map text and - * data as m68k4k executables expect. - * - * This module only works on machines with PAGE_SIZE == 4096. It's not clear - * that making it work on other machines is worth the trouble. - */ - -#if !defined(__m68k__) -#error YOU GOTTA BE KIDDING! -#endif - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/proc.h> -#include <sys/malloc.h> -#include <sys/vnode.h> -#include <sys/exec.h> -#include <sys/resourcevar.h> - -#include <uvm/uvm_extern.h> - -#include <compat/m68k4k/m68k4k_exec.h> - -int exec_m68k4k_prep_zmagic(struct proc *, struct exec_package *); -int exec_m68k4k_prep_nmagic(struct proc *, struct exec_package *); -int exec_m68k4k_prep_omagic(struct proc *, struct exec_package *); - -/* - * exec_m68k4k_makecmds(): Check if it's an a.out-format executable - * with an m68k4k magic number. - * - * Given a proc pointer and an exec package pointer, see if the referent - * of the epp is in a.out format. Just check 'standard' magic numbers for - * this architecture. - * - * This function, in the former case, or the hook, in the latter, 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_m68k4k_makecmds(p, epp) - struct proc *p; - struct exec_package *epp; -{ - u_long midmag, magic; - u_short mid; - int error; - struct exec *execp = epp->ep_hdr; - - /* See note above... */ - if (M68K4K_LDPGSZ != PAGE_SIZE) - return ENOEXEC; - - if (epp->ep_hdrvalid < sizeof(struct exec)) - return ENOEXEC; - - midmag = ntohl(execp->a_midmag); - mid = (midmag >> 16) & 0x3ff; - magic = midmag & 0xffff; - - midmag = mid << 16 | magic; - - switch (midmag) { - case (MID_M68K4K << 16) | ZMAGIC: - error = exec_m68k4k_prep_zmagic(p, epp); - break; - case (MID_M68K4K << 16) | NMAGIC: - error = exec_m68k4k_prep_nmagic(p, epp); - break; - case (MID_M68K4K << 16) | OMAGIC: - error = exec_m68k4k_prep_omagic(p, epp); - break; - default: - error = ENOEXEC; - } - - if (error) - kill_vmcmds(&epp->ep_vmcmds); - - return error; -} - -/* - * exec_m68k4k_prep_zmagic(): Prepare an m68k4k ZMAGIC binary's exec package - * - * First, set of 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_m68k4k_prep_zmagic(p, epp) - struct proc *p; - struct exec_package *epp; -{ - struct exec *execp = epp->ep_hdr; - - epp->ep_taddr = M68K4K_USRTEXT; - epp->ep_tsize = execp->a_text; - epp->ep_daddr = epp->ep_taddr + execp->a_text; - epp->ep_dsize = execp->a_data + execp->a_bss; - epp->ep_entry = execp->a_entry; - - /* - * 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 - */ - if ((execp->a_text != 0 || execp->a_data != 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); - - /* set up command for text segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text, - epp->ep_taddr, epp->ep_vp, 0, VM_PROT_READ|VM_PROT_EXECUTE); - - /* set up command for data segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_data, - epp->ep_daddr, epp->ep_vp, execp->a_text, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* set up command for bss segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, execp->a_bss, - epp->ep_daddr + execp->a_data, NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return exec_setup_stack(p, epp); -} - -/* - * exec_m68k4k_prep_nmagic(): Prepare a m68k4k NMAGIC binary's exec package - */ - -int -exec_m68k4k_prep_nmagic(p, epp) - struct proc *p; - struct exec_package *epp; -{ - struct exec *execp = epp->ep_hdr; - long bsize, baddr; - - epp->ep_taddr = M68K4K_USRTEXT; - epp->ep_tsize = execp->a_text; - epp->ep_daddr = roundup(epp->ep_taddr + execp->a_text, - M68K4K_LDPGSZ); - epp->ep_dsize = execp->a_data + execp->a_bss; - epp->ep_entry = execp->a_entry; - - /* set up command for text segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, execp->a_text, - epp->ep_taddr, epp->ep_vp, sizeof(struct exec), - VM_PROT_READ|VM_PROT_EXECUTE); - - /* set up command for data segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, execp->a_data, - epp->ep_daddr, epp->ep_vp, execp->a_text + sizeof(struct exec), - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* set up command for bss segment */ - baddr = round_page(epp->ep_daddr + execp->a_data); - bsize = epp->ep_daddr + epp->ep_dsize - baddr; - if (bsize > 0) - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, - NULLVP, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return exec_setup_stack(p, epp); -} - -/* - * exec_m68k4k_prep_omagic(): Prepare a m68k4k OMAGIC binary's exec package - */ - -int -exec_m68k4k_prep_omagic(p, epp) - struct proc *p; - struct exec_package *epp; -{ - struct exec *execp = epp->ep_hdr; - long dsize, bsize, baddr; - - epp->ep_taddr = M68K4K_USRTEXT; - epp->ep_tsize = execp->a_text; - epp->ep_daddr = epp->ep_taddr + execp->a_text; - epp->ep_dsize = execp->a_data + execp->a_bss; - epp->ep_entry = execp->a_entry; - - /* set up command for text and data segments */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, - execp->a_text + execp->a_data, epp->ep_taddr, epp->ep_vp, - sizeof(struct exec), VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* set up command for bss segment */ - baddr = round_page(epp->ep_daddr + execp->a_data); - bsize = epp->ep_daddr + epp->ep_dsize - baddr; - if (bsize > 0) - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, - NULLVP, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* - * Make sure (# of pages) mapped above equals (vm_tsize + vm_dsize); - * obreak(2) relies on this fact. Both `vm_tsize' and `vm_dsize' are - * computed (in execve(2)) by rounding *up* `ep_tsize' and `ep_dsize' - * respectively to page boundaries. - * Compensate `ep_dsize' for the amount of data covered by the last - * text page. - */ - dsize = epp->ep_dsize + execp->a_text - round_page(execp->a_text); - epp->ep_dsize = (dsize > 0) ? dsize : 0; - return exec_setup_stack(p, epp); -} diff --git a/sys/compat/m68k4k/m68k4k_exec.h b/sys/compat/m68k4k/m68k4k_exec.h deleted file mode 100644 index dda2573e6b6..00000000000 --- a/sys/compat/m68k4k/m68k4k_exec.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $OpenBSD: m68k4k_exec.h,v 1.3 2008/06/26 05:42:14 ray Exp $ */ -/* $NetBSD: m68k4k_exec.h,v 1.1 1996/09/10 22:01:21 thorpej Exp $ */ - -/*- - * Copyright (c) 1996 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Jason R. Thorpe. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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. - */ - -#ifndef _M68K4K_EXEC_H_ -#define _M68K4K_EXEC_H_ - -#define M68K4K_LDPGSZ 4096 -#define M68K4K_USRTEXT M68K4K_LDPGSZ - -int exec_m68k4k_makecmds(struct proc *, struct exec_package *); - -#endif /* _M68K4K_EXEC_H_ */ diff --git a/sys/compat/sunos/Makefile b/sys/compat/sunos/Makefile deleted file mode 100644 index 86f83f0297a..00000000000 --- a/sys/compat/sunos/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $OpenBSD: Makefile,v 1.4 2001/08/26 03:23:44 deraadt Exp $ -# $NetBSD: Makefile,v 1.1 1996/05/05 16:07:42 veego Exp $ - -DEP= syscalls.conf syscalls.master ../../kern/makesyscalls.sh -OBJS= sunos_sysent.c sunos_syscalls.c sunos_syscall.h sunos_syscallargs.h - -${OBJS}: ${DEP} - sh ../../kern/makesyscalls.sh syscalls.conf syscalls.master diff --git a/sys/compat/sunos/files.sunos b/sys/compat/sunos/files.sunos deleted file mode 100644 index 5f706c5d9b3..00000000000 --- a/sys/compat/sunos/files.sunos +++ /dev/null @@ -1,14 +0,0 @@ -# $OpenBSD: files.sunos,v 1.3 1999/11/10 15:55:23 mickey Exp $ -# $NetBSD: files.sunos,v 1.3 1995/06/24 20:22:33 christos Exp $ -# -# Config.new file description for machine-independent SunOS compat code. -# Included by ports that need it. - -# ports should define any machine-specific files they need in their -# own file lists. - -file compat/sunos/sunos_exec.c compat_sunos -file compat/sunos/sunos_sysent.c compat_sunos -file compat/sunos/sunos_ioctl.c compat_sunos -file compat/sunos/sunos_misc.c compat_sunos -file compat/sunos/sunos_syscalls.c compat_sunos & syscall_debug diff --git a/sys/compat/sunos/sunos.h b/sys/compat/sunos/sunos.h deleted file mode 100644 index 202a204cc05..00000000000 --- a/sys/compat/sunos/sunos.h +++ /dev/null @@ -1,151 +0,0 @@ -/* $OpenBSD: sunos.h,v 1.9 2007/06/06 17:15:13 deraadt Exp $ */ -/* $NetBSD: sunos.h,v 1.8 1996/05/05 16:07:43 veego Exp $ */ - -#define SUNM_RDONLY 0x01 /* mount fs read-only */ -#define SUNM_NOSUID 0x02 /* mount fs with setuid disallowed */ -#define SUNM_NEWTYPE 0x04 /* type is string (char *), not int */ -#define SUNM_GRPID 0x08 /* (bsd semantics; ignored) */ -#define SUNM_REMOUNT 0x10 /* update existing mount */ -#define SUNM_NOSUB 0x20 /* prevent submounts (rejected) */ -#define SUNM_MULTI 0x40 /* (ignored) */ -#define SUNM_SYS5 0x80 /* Sys 5-specific semantics (rejected) */ - -struct sunos_nfs_args { - struct sockaddr_in *addr; /* file server address */ - caddr_t fh; /* file handle to be mounted */ - int flags; /* flags */ - int wsize; /* write size in bytes */ - int rsize; /* read size in bytes */ - int timeo; /* initial timeout in .1 secs */ - int retrans; /* times to retry send */ - char *hostname; /* server's hostname */ - int acregmin; /* attr cache file min secs */ - int acregmax; /* attr cache file max secs */ - int acdirmin; /* attr cache dir min secs */ - int acdirmax; /* attr cache dir max secs */ - char *netname; /* server's netname */ - struct pathcnf *pathconf; /* static pathconf kludge */ -}; -/* SunOS nfs flag values: */ -#define SUNNFS_SOFT 0x1 -#define SUNNFS_WSIZE 0x2 -#define SUNNFS_RSIZE 0x4 -#define SUNNFS_TIMEO 0x8 -#define SUNNFS_RETRANS 0x10 -#define SUNNFS_HOSTNAME 0x20 -#define SUNNFS_INT 0x40 -#define SUNNFS_NOAC 0x80 -#define SUNNFS_ACREGMIN 0x100 -#define SUNNFS_ACREGMAX 0x200 -#define SUNNFS_ACDIRMIN 0x400 -#define SUNNFS_ACDIRMAX 0x800 -#define SUNNFS_SECURE 0x1000 -#define SUNNFS_NOCTO 0x2000 -#define SUNNFS_POSIX 0x4000 - - -struct sunos_ustat { - int32_t f_tfree; /* total free */ - ino_t f_tinode; /* total inodes free */ - char f_path[6]; /* filsys name */ - char f_fpack[6]; /* filsys pack name */ -}; - -struct sunos_statfs { - long f_type; /* type of info, zero for now */ - long f_bsize; /* fundamental file system block size */ - long f_blocks; /* total blocks in file system */ - long f_bfree; /* free blocks */ - long f_bavail; /* free blocks available to non-super-user */ - long f_files; /* total file nodes in file system */ - long f_ffree; /* free file nodes in fs */ - fsid_t f_fsid; /* file system id */ - long f_spare[7]; /* spare for later */ -}; - - -struct sunos_utsname { - char sysname[9]; - char nodename[9]; - char nodeext[65-9]; - char release[9]; - char version[9]; - char machine[9]; -}; - - -struct sunos_ttysize { - int ts_row; - int ts_col; -}; - -struct sunos_termio { - u_short c_iflag; - u_short c_oflag; - u_short c_cflag; - u_short c_lflag; - char c_line; - unsigned char c_cc[8]; -}; -#define SUNOS_TCGETA _IOR('T', 1, struct sunos_termio) -#define SUNOS_TCSETA _IOW('T', 2, struct sunos_termio) -#define SUNOS_TCSETAW _IOW('T', 3, struct sunos_termio) -#define SUNOS_TCSETAF _IOW('T', 4, struct sunos_termio) -#define SUNOS_TCSBRK _IO('T', 5) - -struct sunos_termios { - u_long c_iflag; - u_long c_oflag; - u_long c_cflag; - u_long c_lflag; - char c_line; - u_char c_cc[17]; -}; -#define SUNOS_TCXONC _IO('T', 6) -#define SUNOS_TCFLSH _IO('T', 7) -#define SUNOS_TCGETS _IOR('T', 8, struct sunos_termios) -#define SUNOS_TCSETS _IOW('T', 9, struct sunos_termios) -#define SUNOS_TCSETSW _IOW('T', 10, struct sunos_termios) -#define SUNOS_TCSETSF _IOW('T', 11, struct sunos_termios) -#define SUNOS_TCSNDBRK _IO('T', 12) -#define SUNOS_TCDRAIN _IO('T', 13) - -/* Sun audio compatibility */ -struct sunos_audio_prinfo { - u_int sample_rate; - u_int channels; - u_int precision; - u_int encoding; - u_int gain; - u_int port; - u_int avail_ports; - u_int reserved0[3]; - u_int samples; - u_int eof; - u_char pause; - u_char error; - u_char waiting; - u_char balance; - u_short minordev; - u_char open; - u_char active; -}; -struct sunos_audio_info { - struct sunos_audio_prinfo play; - struct sunos_audio_prinfo record; - u_int monitor_gain; - u_int reserved[4]; -}; - -/* Values for AUDIO_GETDEV ioctl: */ -#define SUNOS_AUDIO_DEV_UNKNOWN 0 -#define SUNOS_AUDIO_DEV_AMD 1 -#define SUNOS_AUDIO_DEV_SPEAKERBOX 2 -#define SUNOS_AUDIO_DEV_CODEC 3 - -__BEGIN_DECLS -/* Defined in arch/m68k/m68k/sunos_machdep.c -- sparc uses regular sendsig() */ -#ifndef __sparc__ -void sunos_sendsig(sig_t, int, int, u_long, int, union sigval); -#endif -__END_DECLS diff --git a/sys/compat/sunos/sunos_dirent.h b/sys/compat/sunos/sunos_dirent.h deleted file mode 100644 index 45b8f4b47af..00000000000 --- a/sys/compat/sunos/sunos_dirent.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenBSD: sunos_dirent.h,v 1.3 1996/08/02 20:35:31 niklas Exp $ */ -/* $NetBSD: sunos_dirent.h,v 1.1 1995/10/09 11:24:10 mycroft Exp $ */ - -/* - * Copyright (c) 1994 Christos Zoulas - * 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 _SUNOS_DIRENT_H_ -#define _SUNOS_DIRENT_H_ - -#define SUNOS_MAXNAMLEN 255 - -struct sunos_dirent { - long d_off; - u_long d_fileno; - u_short d_reclen; - u_short d_namlen; - char d_name[SUNOS_MAXNAMLEN + 1]; -}; - -#define SUNOS_NAMEOFF(dp) ((char *)&(dp)->d_name - (char *)dp) -#define SUNOS_RECLEN(de,namlen) ALIGN((SUNOS_NAMEOFF(de) + (namlen) + 1)) - -#endif /* !_SUNOS_DIRENT_H_ */ diff --git a/sys/compat/sunos/sunos_exec.c b/sys/compat/sunos/sunos_exec.c deleted file mode 100644 index 35dbc70bded..00000000000 --- a/sys/compat/sunos/sunos_exec.c +++ /dev/null @@ -1,269 +0,0 @@ -/* $OpenBSD: sunos_exec.c,v 1.19 2009/03/05 19:52:24 kettenis Exp $ */ -/* $NetBSD: sunos_exec.c,v 1.11 1996/05/05 12:01:47 briggs Exp $ */ - -/* - * Copyright (c) 1993 Theo de Raadt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR 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/filedesc.h> -#include <sys/kernel.h> -#include <sys/proc.h> -#include <sys/mount.h> -#include <sys/malloc.h> -#include <sys/namei.h> -#include <sys/signalvar.h> -#include <sys/vnode.h> -#include <sys/file.h> -#include <sys/core.h> -#include <sys/exec.h> -#include <sys/resourcevar.h> -#include <sys/wait.h> - -#include <sys/mman.h> -#include <uvm/uvm_extern.h> - -#include <machine/cpu.h> -#include <machine/reg.h> -#include <machine/exec.h> - -#include <compat/sunos/sunos.h> -#include <compat/sunos/sunos_exec.h> -#include <compat/sunos/sunos_syscall.h> - -#ifdef __sparc__ -#define sunos_exec_aout_prep_zmagic exec_aout_prep_zmagic -#define sunos_exec_aout_prep_nmagic exec_aout_prep_nmagic -#define sunos_exec_aout_prep_omagic exec_aout_prep_omagic -#endif - -int sunos_exec_aout_makecmds(struct proc *, struct exec_package *); -int sunos_exec_aout_prep_zmagic(struct proc *, struct exec_package *); -int sunos_exec_aout_prep_nmagic(struct proc *, struct exec_package *); -int sunos_exec_aout_prep_omagic(struct proc *, struct exec_package *); - -extern int nsunos_sysent; -extern struct sysent sunos_sysent[]; -#ifdef SYSCALL_DEBUG -extern char *sunos_syscallnames[]; -#endif -extern char sigcode[], esigcode[]; -const char sunos_emul_path[] = "/emul/sunos"; - -struct emul emul_sunos = { - "sunos", - NULL, -#ifdef __sparc__ - sendsig, -#else - sunos_sendsig, -#endif - SUNOS_SYS_syscall, - SUNOS_SYS_MAXSYSCALL, - sunos_sysent, -#ifdef SYSCALL_DEBUG - sunos_syscallnames, -#else - NULL, -#endif - 0, - copyargs, - setregs, - NULL, - coredump_trad, - sigcode, - esigcode, -}; - -int -sunos_exec_aout_makecmds(p, epp) - struct proc *p; - struct exec_package *epp; -{ - struct sunos_exec *sunmag = epp->ep_hdr; - int error = ENOEXEC; - - if (epp->ep_hdrvalid < sizeof(struct sunos_exec)) - return (ENOEXEC); - - if(sunmag->a_machtype != SUNOS_M_NATIVE) - return (ENOEXEC); - - switch (sunmag->a_magic) { - case ZMAGIC: - error = sunos_exec_aout_prep_zmagic(p, epp); - break; - case NMAGIC: - error = sunos_exec_aout_prep_nmagic(p, epp); - break; - case OMAGIC: - error = sunos_exec_aout_prep_omagic(p, epp); - break; - } - if (error==0) - epp->ep_emul = &emul_sunos; - return error; -} - -/* - * the code below is only needed for sun3 emulation. - */ -#ifndef __sparc__ - -/* suns keep data seg aligned to SEGSIZ because of sun custom mmu */ -#define SEGSIZ 0x20000 -#define SUNOS_N_TXTADDR(x,m) __LDPGSZ -#define SUNOS_N_DATADDR(x,m) (((m)==OMAGIC) ? \ - (SUNOS_N_TXTADDR(x,m) + (x).a_text) : \ - (SEGSIZ + ((SUNOS_N_TXTADDR(x,m) + (x).a_text - 1) & ~(SEGSIZ-1)))) -#define SUNOS_N_BSSADDR(x,m) (SUNOS_N_DATADDR(x,m)+(x).a_data) - -#define SUNOS_N_TXTOFF(x,m) ((m)==ZMAGIC ? 0 : sizeof (struct exec)) -#define SUNOS_N_DATOFF(x,m) (SUNOS_N_TXTOFF(x,m) + (x).a_text) - -/* - * sunos_exec_aout_prep_zmagic(): Prepare a SunOS ZMAGIC binary's exec package - * - * First, set of 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 -sunos_exec_aout_prep_zmagic(p, epp) - struct proc *p; - struct exec_package *epp; -{ - struct exec *execp = epp->ep_hdr; - - epp->ep_taddr = SUNOS_N_TXTADDR(*execp, ZMAGIC); - epp->ep_tsize = execp->a_text; - epp->ep_daddr = SUNOS_N_DATADDR(*execp, ZMAGIC); - epp->ep_dsize = execp->a_data + execp->a_bss; - epp->ep_entry = execp->a_entry; - - /* - * 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 - */ - if ((execp->a_text != 0 || execp->a_data != 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); - - /* set up command for text segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text, - epp->ep_taddr, epp->ep_vp, SUNOS_N_TXTOFF(*execp, ZMAGIC), - VM_PROT_READ|VM_PROT_EXECUTE); - - /* set up command for data segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_data, - epp->ep_daddr, epp->ep_vp, SUNOS_N_DATOFF(*execp, ZMAGIC), - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* set up command for bss segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, execp->a_bss, - epp->ep_daddr + execp->a_data, NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return exec_setup_stack(p, epp); -} - -/* - * sunos_exec_aout_prep_nmagic(): Prepare a SunOS NMAGIC binary's exec package - */ -int -sunos_exec_aout_prep_nmagic(p, epp) - struct proc *p; - struct exec_package *epp; -{ - struct exec *execp = epp->ep_hdr; - long bsize, baddr; - - epp->ep_taddr = SUNOS_N_TXTADDR(*execp, NMAGIC); - epp->ep_tsize = execp->a_text; - epp->ep_daddr = SUNOS_N_DATADDR(*execp, NMAGIC); - epp->ep_dsize = execp->a_data + execp->a_bss; - epp->ep_entry = execp->a_entry; - - /* set up command for text segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, execp->a_text, - epp->ep_taddr, epp->ep_vp, SUNOS_N_TXTOFF(*execp, NMAGIC), - VM_PROT_READ|VM_PROT_EXECUTE); - - /* set up command for data segment */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, execp->a_data, - epp->ep_daddr, epp->ep_vp, SUNOS_N_DATOFF(*execp, NMAGIC), - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* set up command for bss segment */ - baddr = round_page(epp->ep_daddr + execp->a_data); - bsize = epp->ep_daddr + epp->ep_dsize - baddr; - if (bsize > 0) - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, - NULLVP, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return exec_setup_stack(p, epp); -} - -/* - * sunos_exec_aout_prep_omagic(): Prepare a SunOS OMAGIC binary's exec package - */ -int -sunos_exec_aout_prep_omagic(p, epp) - struct proc *p; - struct exec_package *epp; -{ - struct exec *execp = epp->ep_hdr; - long bsize, baddr; - - epp->ep_taddr = SUNOS_N_TXTADDR(*execp, OMAGIC); - epp->ep_tsize = execp->a_text; - epp->ep_daddr = SUNOS_N_DATADDR(*execp, OMAGIC); - epp->ep_dsize = execp->a_data + execp->a_bss; - epp->ep_entry = execp->a_entry; - - /* set up command for text and data segments */ - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, - execp->a_text + execp->a_data, epp->ep_taddr, epp->ep_vp, - SUNOS_N_TXTOFF(*execp, OMAGIC), VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - /* set up command for bss segment */ - baddr = round_page(epp->ep_daddr + execp->a_data); - bsize = epp->ep_daddr + epp->ep_dsize - baddr; - if (bsize > 0) - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, - NULLVP, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return exec_setup_stack(p, epp); -} -#endif /* !__sparc__ */ diff --git a/sys/compat/sunos/sunos_exec.h b/sys/compat/sunos/sunos_exec.h deleted file mode 100644 index db446e6b42e..00000000000 --- a/sys/compat/sunos/sunos_exec.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenBSD: sunos_exec.h,v 1.2 2003/06/02 15:54:31 deraadt Exp $ */ -/* $NetBSD: exec.h,v 1.4 1994/10/25 23:03:22 deraadt Exp $ */ - -/* - * Copyright (c) 1993 Theo de Raadt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR 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 _SUNOS_EXEC_H_ -#define _SUNOS_EXEC_H_ - -struct sunos_exec { - u_char a_dynamic:1; /* has a __DYNAMIC */ - u_char a_toolversion:7;/* version of toolset used to create this file */ - u_char a_machtype; /* machine type */ - u_short a_magic; /* magic number */ -}; -#define SUNOS_M_68020 2 /* runs only on 68020 */ -#define SUNOS_M_SPARC 3 /* runs only on SPARC */ - -#ifdef __sparc__ -#define SUNOS_M_NATIVE SUNOS_M_SPARC -#else -#define SUNOS_M_NATIVE SUNOS_M_68020 -#endif - -#endif /* !_SUNOS_EXEC_H_ */ diff --git a/sys/compat/sunos/sunos_ioctl.c b/sys/compat/sunos/sunos_ioctl.c deleted file mode 100644 index 7595ef9ee00..00000000000 --- a/sys/compat/sunos/sunos_ioctl.c +++ /dev/null @@ -1,1051 +0,0 @@ -/* $OpenBSD: sunos_ioctl.c,v 1.16 2004/09/19 21:34:43 mickey Exp $ */ -/* $NetBSD: sunos_ioctl.c,v 1.23 1996/03/14 19:33:46 christos Exp $ */ - -/* - * Copyright (c) 1993 Markus Wild. - * 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. - * - * loosely from: Header: sunos_ioctl.c,v 1.7 93/05/28 04:40:43 torek Exp - */ - -#include <sys/param.h> -#include <sys/proc.h> -#include <sys/systm.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/audioio.h> -#include <sys/vnode.h> -#include <net/if.h> - -#include <sys/mount.h> - -#include <miscfs/specfs/specdev.h> - -#include <sys/syscallargs.h> -#include <compat/sunos/sunos.h> -#include <compat/sunos/sunos_syscallargs.h> -#include <compat/sunos/sunos_util.h> - -/* - * SunOS ioctl calls. - * This file is something of a hodge-podge. - * Support gets added as things turn up.... - */ - -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 sunos_termios *, struct termios *); -static void btios2stios(struct termios *, struct sunos_termios *); -static void stios2stio(struct sunos_termios *, struct sunos_termio *); -static void stio2stios(struct sunos_termio *, struct sunos_termios *); - -/* - * These two conversion functions have mostly been done - * with some perl cut&paste, then hand-edited to comment - * out what doesn't exist under NetBSD. - * A note from Markus's code: - * (l & BITMASK1) / BITMASK1 * BITMASK2 is translated - * optimally by gcc m68k, much better than any ?: stuff. - * Code may vary with different architectures of course. - * - * I don't know what optimizer you used, but seeing divu's and - * bfextu's in the m68k assembly output did not encourage me... - * as well, gcc on the sparc definitely generates much better - * code with `?:'. - */ - -static void -stios2btios(st, bt) - struct sunos_termios *st; - struct termios *bt; -{ - register u_long l, r; - - l = st->c_iflag; - r = ((l & 0x00000001) ? IGNBRK : 0); - r |= ((l & 0x00000002) ? BRKINT : 0); - r |= ((l & 0x00000004) ? IGNPAR : 0); - r |= ((l & 0x00000008) ? PARMRK : 0); - r |= ((l & 0x00000010) ? INPCK : 0); - r |= ((l & 0x00000020) ? ISTRIP : 0); - r |= ((l & 0x00000040) ? INLCR : 0); - r |= ((l & 0x00000080) ? IGNCR : 0); - r |= ((l & 0x00000100) ? ICRNL : 0); - /* ((l & 0x00000200) ? IUCLC : 0) */ - r |= ((l & 0x00000400) ? IXON : 0); - r |= ((l & 0x00000800) ? IXANY : 0); - r |= ((l & 0x00001000) ? IXOFF : 0); - r |= ((l & 0x00002000) ? IMAXBEL : 0); - bt->c_iflag = r; - - l = st->c_oflag; - r = ((l & 0x00000001) ? OPOST : 0); - /* ((l & 0x00000002) ? OLCUC : 0) */ - r |= ((l & 0x00000004) ? ONLCR : 0); - /* ((l & 0x00000008) ? OCRNL : 0) */ - /* ((l & 0x00000010) ? ONOCR : 0) */ - /* ((l & 0x00000020) ? ONLRET : 0) */ - /* ((l & 0x00000040) ? OFILL : 0) */ - /* ((l & 0x00000080) ? OFDEL : 0) */ - /* ((l & 0x00000100) ? NLDLY : 0) */ - /* ((l & 0x00000100) ? NL1 : 0) */ - /* ((l & 0x00000600) ? CRDLY : 0) */ - /* ((l & 0x00000200) ? CR1 : 0) */ - /* ((l & 0x00000400) ? CR2 : 0) */ - /* ((l & 0x00000600) ? CR3 : 0) */ - /* ((l & 0x00001800) ? TABDLY : 0) */ - /* ((l & 0x00000800) ? TAB1 : 0) */ - /* ((l & 0x00001000) ? TAB2 : 0) */ - r |= ((l & 0x00001800) ? OXTABS : 0); - /* ((l & 0x00002000) ? BSDLY : 0) */ - /* ((l & 0x00002000) ? BS1 : 0) */ - /* ((l & 0x00004000) ? VTDLY : 0) */ - /* ((l & 0x00004000) ? VT1 : 0) */ - /* ((l & 0x00008000) ? FFDLY : 0) */ - /* ((l & 0x00008000) ? FF1 : 0) */ - /* ((l & 0x00010000) ? PAGEOUT : 0) */ - /* ((l & 0x00020000) ? WRAP : 0) */ - bt->c_oflag = r; - - l = st->c_cflag; - switch (l & 0x00000030) { - case 0: - r = CS5; - break; - case 0x00000010: - r = CS6; - break; - case 0x00000020: - r = CS7; - break; - case 0x00000030: - r = CS8; - break; - } - r |= ((l & 0x00000040) ? CSTOPB : 0); - r |= ((l & 0x00000080) ? CREAD : 0); - r |= ((l & 0x00000100) ? PARENB : 0); - r |= ((l & 0x00000200) ? PARODD : 0); - r |= ((l & 0x00000400) ? HUPCL : 0); - r |= ((l & 0x00000800) ? CLOCAL : 0); - /* ((l & 0x00001000) ? LOBLK : 0) */ - r |= ((l & 0x80000000) ? (CRTS_IFLOW|CCTS_OFLOW) : 0); - bt->c_cflag = r; - - bt->c_ispeed = bt->c_ospeed = s2btab[l & 0x0000000f]; - - l = st->c_lflag; - r = ((l & 0x00000001) ? ISIG : 0); - r |= ((l & 0x00000002) ? ICANON : 0); - /* ((l & 0x00000004) ? XCASE : 0) */ - r |= ((l & 0x00000008) ? ECHO : 0); - r |= ((l & 0x00000010) ? ECHOE : 0); - r |= ((l & 0x00000020) ? ECHOK : 0); - r |= ((l & 0x00000040) ? ECHONL : 0); - r |= ((l & 0x00000080) ? NOFLSH : 0); - r |= ((l & 0x00000100) ? TOSTOP : 0); - r |= ((l & 0x00000200) ? ECHOCTL : 0); - r |= ((l & 0x00000400) ? ECHOPRT : 0); - r |= ((l & 0x00000800) ? ECHOKE : 0); - /* ((l & 0x00001000) ? DEFECHO : 0) */ - r |= ((l & 0x00002000) ? FLUSHO : 0); - r |= ((l & 0x00004000) ? PENDIN : 0); - bt->c_lflag = r; - - bt->c_cc[VINTR] = st->c_cc[0] ? st->c_cc[0] : _POSIX_VDISABLE; - bt->c_cc[VQUIT] = st->c_cc[1] ? st->c_cc[1] : _POSIX_VDISABLE; - bt->c_cc[VERASE] = st->c_cc[2] ? st->c_cc[2] : _POSIX_VDISABLE; - bt->c_cc[VKILL] = st->c_cc[3] ? st->c_cc[3] : _POSIX_VDISABLE; - bt->c_cc[VEOF] = st->c_cc[4] ? st->c_cc[4] : _POSIX_VDISABLE; - bt->c_cc[VEOL] = st->c_cc[5] ? st->c_cc[5] : _POSIX_VDISABLE; - bt->c_cc[VEOL2] = st->c_cc[6] ? st->c_cc[6] : _POSIX_VDISABLE; - /* bt->c_cc[VSWTCH] = st->c_cc[7] ? st->c_cc[7] : _POSIX_VDISABLE; */ - bt->c_cc[VSTART] = st->c_cc[8] ? st->c_cc[8] : _POSIX_VDISABLE; - bt->c_cc[VSTOP] = st->c_cc[9] ? st->c_cc[9] : _POSIX_VDISABLE; - bt->c_cc[VSUSP] = st->c_cc[10] ? st->c_cc[10] : _POSIX_VDISABLE; - bt->c_cc[VDSUSP] = st->c_cc[11] ? st->c_cc[11] : _POSIX_VDISABLE; - bt->c_cc[VREPRINT] = st->c_cc[12] ? st->c_cc[12] : _POSIX_VDISABLE; - bt->c_cc[VDISCARD] = st->c_cc[13] ? st->c_cc[13] : _POSIX_VDISABLE; - bt->c_cc[VWERASE] = st->c_cc[14] ? st->c_cc[14] : _POSIX_VDISABLE; - bt->c_cc[VLNEXT] = st->c_cc[15] ? st->c_cc[15] : _POSIX_VDISABLE; - bt->c_cc[VSTATUS] = st->c_cc[16] ? st->c_cc[16] : _POSIX_VDISABLE; - - /* if `raw mode', create native VMIN/VTIME from SunOS VEOF/VEOL */ - bt->c_cc[VMIN] = (bt->c_lflag & ICANON) ? 1 : bt->c_cc[VEOF]; - bt->c_cc[VTIME] = (bt->c_lflag & ICANON) ? 1 : bt->c_cc[VEOL]; -} - - -static void -btios2stios(bt, st) - struct termios *bt; - struct sunos_termios *st; -{ - register u_long l, r; - int s; - - l = bt->c_iflag; - r = ((l & IGNBRK) ? 0x00000001 : 0); - r |= ((l & BRKINT) ? 0x00000002 : 0); - r |= ((l & IGNPAR) ? 0x00000004 : 0); - r |= ((l & PARMRK) ? 0x00000008 : 0); - r |= ((l & INPCK) ? 0x00000010 : 0); - r |= ((l & ISTRIP) ? 0x00000020 : 0); - r |= ((l & INLCR) ? 0x00000040 : 0); - r |= ((l & IGNCR) ? 0x00000080 : 0); - r |= ((l & ICRNL) ? 0x00000100 : 0); - /* ((l & IUCLC) ? 0x00000200 : 0) */ - r |= ((l & IXON) ? 0x00000400 : 0); - r |= ((l & IXANY) ? 0x00000800 : 0); - r |= ((l & IXOFF) ? 0x00001000 : 0); - r |= ((l & IMAXBEL) ? 0x00002000 : 0); - st->c_iflag = r; - - l = bt->c_oflag; - r = ((l & OPOST) ? 0x00000001 : 0); - /* ((l & OLCUC) ? 0x00000002 : 0) */ - r |= ((l & ONLCR) ? 0x00000004 : 0); - /* ((l & OCRNL) ? 0x00000008 : 0) */ - /* ((l & ONOCR) ? 0x00000010 : 0) */ - /* ((l & ONLRET) ? 0x00000020 : 0) */ - /* ((l & OFILL) ? 0x00000040 : 0) */ - /* ((l & OFDEL) ? 0x00000080 : 0) */ - /* ((l & NLDLY) ? 0x00000100 : 0) */ - /* ((l & NL1) ? 0x00000100 : 0) */ - /* ((l & CRDLY) ? 0x00000600 : 0) */ - /* ((l & CR1) ? 0x00000200 : 0) */ - /* ((l & CR2) ? 0x00000400 : 0) */ - /* ((l & CR3) ? 0x00000600 : 0) */ - /* ((l & TABDLY) ? 0x00001800 : 0) */ - /* ((l & TAB1) ? 0x00000800 : 0) */ - /* ((l & TAB2) ? 0x00001000 : 0) */ - r |= ((l & OXTABS) ? 0x00001800 : 0); - /* ((l & BSDLY) ? 0x00002000 : 0) */ - /* ((l & BS1) ? 0x00002000 : 0) */ - /* ((l & VTDLY) ? 0x00004000 : 0) */ - /* ((l & VT1) ? 0x00004000 : 0) */ - /* ((l & FFDLY) ? 0x00008000 : 0) */ - /* ((l & FF1) ? 0x00008000 : 0) */ - /* ((l & PAGEOUT) ? 0x00010000 : 0) */ - /* ((l & WRAP) ? 0x00020000 : 0) */ - st->c_oflag = r; - - l = bt->c_cflag; - switch (l & CSIZE) { - case CS5: - r = 0; - break; - case CS6: - r = 0x00000010; - break; - case CS7: - r = 0x00000020; - break; - case CS8: - r = 0x00000030; - break; - } - r |= ((l & CSTOPB) ? 0x00000040 : 0); - r |= ((l & CREAD) ? 0x00000080 : 0); - r |= ((l & PARENB) ? 0x00000100 : 0); - r |= ((l & PARODD) ? 0x00000200 : 0); - r |= ((l & HUPCL) ? 0x00000400 : 0); - r |= ((l & CLOCAL) ? 0x00000800 : 0); - /* ((l & LOBLK) ? 0x00001000 : 0) */ - r |= ((l & (CRTS_IFLOW|CCTS_OFLOW)) ? 0x80000000 : 0); - st->c_cflag = r; - - l = bt->c_lflag; - r = ((l & ISIG) ? 0x00000001 : 0); - r |= ((l & ICANON) ? 0x00000002 : 0); - /* ((l & XCASE) ? 0x00000004 : 0) */ - r |= ((l & ECHO) ? 0x00000008 : 0); - r |= ((l & ECHOE) ? 0x00000010 : 0); - r |= ((l & ECHOK) ? 0x00000020 : 0); - r |= ((l & ECHONL) ? 0x00000040 : 0); - r |= ((l & NOFLSH) ? 0x00000080 : 0); - r |= ((l & TOSTOP) ? 0x00000100 : 0); - r |= ((l & ECHOCTL) ? 0x00000200 : 0); - r |= ((l & ECHOPRT) ? 0x00000400 : 0); - r |= ((l & ECHOKE) ? 0x00000800 : 0); - /* ((l & DEFECHO) ? 0x00001000 : 0) */ - r |= ((l & FLUSHO) ? 0x00002000 : 0); - r |= ((l & PENDIN) ? 0x00004000 : 0); - st->c_lflag = r; - - s = ttspeedtab(bt->c_ospeed, sptab); - if (s >= 0) - st->c_cflag |= s; - - st->c_cc[0] = bt->c_cc[VINTR] != _POSIX_VDISABLE? bt->c_cc[VINTR]:0; - st->c_cc[1] = bt->c_cc[VQUIT] != _POSIX_VDISABLE? bt->c_cc[VQUIT]:0; - st->c_cc[2] = bt->c_cc[VERASE] != _POSIX_VDISABLE? bt->c_cc[VERASE]:0; - st->c_cc[3] = bt->c_cc[VKILL] != _POSIX_VDISABLE? bt->c_cc[VKILL]:0; - st->c_cc[4] = bt->c_cc[VEOF] != _POSIX_VDISABLE? bt->c_cc[VEOF]:0; - st->c_cc[5] = bt->c_cc[VEOL] != _POSIX_VDISABLE? bt->c_cc[VEOL]:0; - st->c_cc[6] = bt->c_cc[VEOL2] != _POSIX_VDISABLE? bt->c_cc[VEOL2]:0; - st->c_cc[7] = 0; - /* bt->c_cc[VSWTCH] != _POSIX_VDISABLE? bt->c_cc[VSWTCH]: */ - st->c_cc[8] = bt->c_cc[VSTART] != _POSIX_VDISABLE? bt->c_cc[VSTART]:0; - st->c_cc[9] = bt->c_cc[VSTOP] != _POSIX_VDISABLE? bt->c_cc[VSTOP]:0; - st->c_cc[10]= bt->c_cc[VSUSP] != _POSIX_VDISABLE? bt->c_cc[VSUSP]:0; - st->c_cc[11]= bt->c_cc[VDSUSP] != _POSIX_VDISABLE? bt->c_cc[VDSUSP]:0; - st->c_cc[12]= bt->c_cc[VREPRINT]!= _POSIX_VDISABLE? bt->c_cc[VREPRINT]:0; - st->c_cc[13]= bt->c_cc[VDISCARD]!= _POSIX_VDISABLE? bt->c_cc[VDISCARD]:0; - st->c_cc[14]= bt->c_cc[VWERASE] != _POSIX_VDISABLE? bt->c_cc[VWERASE]:0; - st->c_cc[15]= bt->c_cc[VLNEXT] != _POSIX_VDISABLE? bt->c_cc[VLNEXT]:0; - st->c_cc[16]= bt->c_cc[VSTATUS] != _POSIX_VDISABLE? bt->c_cc[VSTATUS]:0; - - if (!(bt->c_lflag & ICANON)) { - /* SunOS stores VMIN/VTIME in VEOF/VEOL (if ICANON is off) */ - st->c_cc[4] = bt->c_cc[VMIN]; - st->c_cc[5] = bt->c_cc[VTIME]; - } - - st->c_line = 0; -} - -static void -stios2stio(ts, t) - struct sunos_termios *ts; - struct sunos_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, 8); -} - -static void -stio2stios(t, ts) - struct sunos_termio *t; - struct sunos_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, 8); /* don't touch the upper fields! */ -} - -int -sunos_sys_ioctl(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_ioctl_args *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) { - error = EBADF; - goto out; - } - - ctl = fp->f_ops->fo_ioctl; - - switch (SCARG(uap, com)) { - case _IOR('t', 0, int): - SCARG(uap, com) = TIOCGETD; - break; - case _IOW('t', 1, int): - { - int disc; - - if ((error = copyin(SCARG(uap, data), (caddr_t)&disc, - sizeof disc)) != 0) - goto out; - - /* map SunOS NTTYDISC into our termios discipline */ - if (disc == 2) - disc = 0; - /* all other disciplines are not supported by NetBSD */ - if (disc) { - error = ENXIO; - goto out; - } - - error = (*ctl)(fp, TIOCSETD, (caddr_t)&disc, p); - goto out; - } - case _IOW('t', 101, int): /* sun SUNOS_TIOCSSOFTCAR */ - { - int x; /* unused */ - - error = copyin((caddr_t)&x, SCARG(uap, data), sizeof x); - goto out; - } - case _IOR('t', 100, int): /* sun SUNOS_TIOCGSOFTCAR */ - { - int x = 0; - - error = copyout((caddr_t)&x, SCARG(uap, data), sizeof x); - goto out; - } - case _IO('t', 36): /* sun TIOCCONS, no parameters */ - { - int on = 1; - error = (*ctl)(fp, TIOCCONS, (caddr_t)&on, p); - goto out; - } - case _IOW('t', 37, struct sunos_ttysize): - { - struct winsize ws; - struct sunos_ttysize ss; - - if ((error = (*ctl)(fp, TIOCGWINSZ, (caddr_t)&ws, p)) != 0) - goto out; - - if ((error = copyin (SCARG(uap, data), &ss, sizeof (ss))) != 0) - goto out; - - ws.ws_row = ss.ts_row; - ws.ws_col = ss.ts_col; - - error = ((*ctl)(fp, TIOCSWINSZ, (caddr_t)&ws, p)); - goto out; - } - case _IOW('t', 38, struct sunos_ttysize): - { - struct winsize ws; - struct sunos_ttysize ss; - - if ((error = (*ctl)(fp, TIOCGWINSZ, (caddr_t)&ws, p)) != 0) - goto out; - - ss.ts_row = ws.ws_row; - ss.ts_col = ws.ws_col; - - error = copyout ((caddr_t)&ss, SCARG(uap, data), sizeof (ss)); - goto out; - } - case _IOW('t', 130, int): /* TIOCSETPGRP: posix variant */ - SCARG(uap, com) = TIOCSPGRP; - break; - case _IOR('t', 131, int): /* TIOCGETPGRP: posix variant */ - { - /* - * sigh, must do error translation on pty devices - * (see also kern/tty_pty.c) - */ - int pgrp; - struct vnode *vp; - error = (*ctl)(fp, TIOCGPGRP, (caddr_t)&pgrp, p); - if (error) { - vp = (struct vnode *)fp->f_data; - if (error == EIO && vp != NULL && - vp->v_type == VCHR && major(vp->v_rdev) == 21) - error = ENOTTY; - goto out; - } - error = copyout((caddr_t)&pgrp, SCARG(uap, data), sizeof(pgrp)); - goto out; - } - case _IO('t', 132): - SCARG(uap, com) = TIOCSCTTY; - break; - case SUNOS_TCFLSH: - /* XXX: fixme */ - error = 0; - goto out; - case SUNOS_TCGETA: - case SUNOS_TCGETS: - { - struct termios bts; - struct sunos_termios sts; - struct sunos_termio st; - - if ((error = (*ctl)(fp, TIOCGETA, (caddr_t)&bts, p)) != 0) - goto out; - - btios2stios (&bts, &sts); - if (SCARG(uap, com) == SUNOS_TCGETA) { - stios2stio (&sts, &st); - error = copyout((caddr_t)&st, SCARG(uap, data), - sizeof (st)); - goto out; - } else { - error = copyout((caddr_t)&sts, SCARG(uap, data), - sizeof (sts)); - goto out; - } - /*NOTREACHED*/ - } - case SUNOS_TCSETA: - case SUNOS_TCSETAW: - case SUNOS_TCSETAF: - { - struct termios bts; - struct sunos_termios sts; - struct sunos_termio st; - - if ((error = copyin(SCARG(uap, data), (caddr_t)&st, - sizeof (st))) != 0) - goto out; - - /* get full BSD termios so we don't lose information */ - if ((error = (*ctl)(fp, TIOCGETA, (caddr_t)&bts, p)) != 0) - goto out; - - /* - * convert to sun 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, com) - SUNOS_TCSETA + TIOCSETA, - (caddr_t)&bts, p); - goto out; - } - case SUNOS_TCSETS: - case SUNOS_TCSETSW: - case SUNOS_TCSETSF: - { - struct termios bts; - struct sunos_termios sts; - - if ((error = copyin (SCARG(uap, data), (caddr_t)&sts, - sizeof (sts))) != 0) - goto out; - stios2btios (&sts, &bts); - error = (*ctl)(fp, SCARG(uap, com) - SUNOS_TCSETS + TIOCSETA, - (caddr_t)&bts, p); - goto out; - } -/* - * Pseudo-tty ioctl translations. - */ - case _IOW('t', 32, int): { /* TIOCTCNTL */ - int error, on; - - error = copyin (SCARG(uap, data), (caddr_t)&on, sizeof (on)); - if (error) - goto out; - error = (*ctl)(fp, TIOCUCNTL, (caddr_t)&on, p); - goto out; - } - case _IOW('t', 33, int): { /* TIOCSIGNAL */ - int error, sig; - - error = copyin (SCARG(uap, data), (caddr_t)&sig, sizeof (sig)); - if (error) - goto out; - error = (*ctl)(fp, TIOCSIG, (caddr_t)&sig, p); - goto out; - } - -/* - * Socket ioctl translations. - */ -#define IFREQ_IN(a) { \ - struct ifreq ifreq; \ - error = copyin (SCARG(uap, data), (caddr_t)&ifreq, sizeof (ifreq)); \ - if (error) \ - goto out; \ - error = (*ctl)(fp, a, (caddr_t)&ifreq, p); \ - goto out; \ -} -#define IFREQ_INOUT(a) { \ - struct ifreq ifreq; \ - error = copyin (SCARG(uap, data), (caddr_t)&ifreq, sizeof (ifreq)); \ - if (error) \ - goto out; \ - if ((error = (*ctl)(fp, a, (caddr_t)&ifreq, p)) != 0) \ - goto out; \ - error = copyout ((caddr_t)&ifreq, SCARG(uap, data), sizeof (ifreq)); \ - goto out; \ -} - - case _IOW('i', 12, struct ifreq): - /* SIOCSIFADDR */ - break; - - case _IOWR('i', 13, struct ifreq): - IFREQ_INOUT(OSIOCGIFADDR); - - case _IOW('i', 14, struct ifreq): - /* SIOCSIFDSTADDR */ - break; - - case _IOWR('i', 15, struct ifreq): - IFREQ_INOUT(OSIOCGIFDSTADDR); - - case _IOW('i', 16, struct ifreq): - /* SIOCSIFFLAGS */ - break; - - case _IOWR('i', 17, struct ifreq): - /* SIOCGIFFLAGS */ - break; - - case _IOW('i', 21, struct ifreq): - IFREQ_IN(SIOCSIFMTU); - - case _IOWR('i', 22, struct ifreq): - IFREQ_INOUT(SIOCGIFMTU); - - case _IOWR('i', 23, struct ifreq): - IFREQ_INOUT(SIOCGIFBRDADDR); - - case _IOW('i', 24, struct ifreq): - IFREQ_IN(SIOCSIFBRDADDR); - - case _IOWR('i', 25, struct ifreq): - IFREQ_INOUT(OSIOCGIFNETMASK); - - case _IOW('i', 26, struct ifreq): - IFREQ_IN(SIOCSIFNETMASK); - - case _IOWR('i', 27, struct ifreq): - IFREQ_INOUT(SIOCGIFMETRIC); - - case _IOWR('i', 28, struct ifreq): - IFREQ_IN(SIOCSIFMETRIC); - - case _IOW('i', 30, struct arpreq): - /* SIOCSARP */ - break; - - case _IOWR('i', 31, struct arpreq): - /* SIOCGARP */ - break; - - case _IOW('i', 32, struct arpreq): - /* SIOCDARP */ - break; - - case _IOW('i', 18, struct ifreq): /* SIOCSIFMEM */ - case _IOWR('i', 19, struct ifreq): /* SIOCGIFMEM */ - case _IOW('i', 40, struct ifreq): /* SIOCUPPER */ - case _IOW('i', 41, struct ifreq): /* SIOCLOWER */ - case _IOW('i', 44, struct ifreq): /* SIOCSETSYNC */ - case _IOWR('i', 45, struct ifreq): /* SIOCGETSYNC */ - case _IOWR('i', 46, struct ifreq): /* SIOCSDSTATS */ - case _IOWR('i', 47, struct ifreq): /* SIOCSESTATS */ - case _IOW('i', 48, int): /* SIOCSPROMISC */ - case _IOW('i', 49, struct ifreq): /* SIOCADDMULTI */ - case _IOW('i', 50, struct ifreq): /* SIOCDELMULTI */ - error = EOPNOTSUPP; - goto out; - - case _IOWR('i', 20, struct ifconf): /* SIOCGIFCONF */ - { - struct ifconf ifconf; - - /* - * XXX: two more problems - * 1. our sockaddr's are variable length, not always sizeof(sockaddr) - * 2. this returns a name per protocol, ie. it returns two "lo0"'s - */ - error = copyin (SCARG(uap, data), (caddr_t)&ifconf, - sizeof (ifconf)); - if (error) - goto out; - error = (*ctl)(fp, OSIOCGIFCONF, (caddr_t)&ifconf, p); - if (error) - goto out; - error = copyout ((caddr_t)&ifconf, SCARG(uap, data), - sizeof (ifconf)); - goto out; - } - -/* - * Audio ioctl translations. - */ - case _IOR('A', 1, struct sunos_audio_info): /* AUDIO_GETINFO */ - sunos_au_getinfo: - { - struct audio_info aui; - struct sunos_audio_info sunos_aui; - - error = (*ctl)(fp, AUDIO_GETINFO, (caddr_t)&aui, p); - if (error) - goto out; - - sunos_aui.play = *(struct sunos_audio_prinfo *)&aui.play; - sunos_aui.record = *(struct sunos_audio_prinfo *)&aui.record; - - /* `avail_ports' is `seek' in BSD */ - sunos_aui.play.avail_ports = AUDIO_SPEAKER | AUDIO_HEADPHONE; - sunos_aui.record.avail_ports = AUDIO_SPEAKER | AUDIO_HEADPHONE; - - sunos_aui.play.waiting = 0; - sunos_aui.record.waiting = 0; - sunos_aui.play.eof = 0; - sunos_aui.record.eof = 0; - sunos_aui.monitor_gain = 0; /* aui.__spare; XXX */ - /*XXXsunos_aui.output_muted = 0;*/ - /*XXX*/sunos_aui.reserved[0] = 0; - /*XXX*/sunos_aui.reserved[1] = 0; - /*XXX*/sunos_aui.reserved[2] = 0; - /*XXX*/sunos_aui.reserved[3] = 0; - - error = copyout ((caddr_t)&sunos_aui, SCARG(uap, data), - sizeof (sunos_aui)); - goto out; - } - - case _IOWR('A', 2, struct sunos_audio_info): /* AUDIO_SETINFO */ - { - struct audio_info aui; - struct sunos_audio_info sunos_aui; - - error = copyin (SCARG(uap, data), (caddr_t)&sunos_aui, - sizeof (sunos_aui)); - if (error) - goto out; - - aui.play = *(struct audio_prinfo *)&sunos_aui.play; - aui.record = *(struct audio_prinfo *)&sunos_aui.record; - /* aui.__spare = sunos_aui.monitor_gain; */ - aui.blocksize = ~0; - aui.hiwat = ~0; - aui.lowat = ~0; - /* XXX somebody check this please. - is: aui.backlog = ~0; */ - aui.mode = ~0; - /* - * The bsd driver does not distinguish between paused and - * active. (In the sun driver, not active means samples are - * not output at all, but paused means the last streams buffer - * is drained and then output stops.) If either are 0, then - * when stop output. Otherwise, if either are non-zero, - * we resume. - */ - if (sunos_aui.play.pause == 0 || sunos_aui.play.active == 0) - aui.play.pause = 0; - else if (sunos_aui.play.pause != (u_char)~0 || - sunos_aui.play.active != (u_char)~0) - aui.play.pause = 1; - if (sunos_aui.record.pause == 0 || sunos_aui.record.active == 0) - aui.record.pause = 0; - else if (sunos_aui.record.pause != (u_char)~0 || - sunos_aui.record.active != (u_char)~0) - aui.record.pause = 1; - - error = (*ctl)(fp, AUDIO_SETINFO, (caddr_t)&aui, p); - if (error) - goto out; - /* Return new state */ - goto sunos_au_getinfo; - } - case _IO('A', 3): /* AUDIO_DRAIN */ - error = (*ctl)(fp, AUDIO_DRAIN, (void *)0, p); - goto out; - case _IOR('A', 4, int): /* AUDIO_GETDEV */ - { - int devtype = SUNOS_AUDIO_DEV_AMD; - error = copyout ((caddr_t)&devtype, SCARG(uap, data), - sizeof (devtype)); - goto out; - } - -/* - * Selected streams ioctls. - */ -#define SUNOS_S_FLUSHR 1 -#define SUNOS_S_FLUSHW 2 -#define SUNOS_S_FLUSHRW 3 - -#define SUNOS_S_INPUT 1 -#define SUNOS_S_HIPRI 2 -#define SUNOS_S_OUTPUT 4 -#define SUNOS_S_MSG 8 - - case _IO('S', 5): /* I_FLUSH */ - { - int tmp = 0; - switch ((int)SCARG(uap, data)) { - case SUNOS_S_FLUSHR: - tmp = FREAD; - break; - case SUNOS_S_FLUSHW: - tmp = FWRITE; - break; - case SUNOS_S_FLUSHRW: - tmp = FREAD|FWRITE; - break; - } - error = (*ctl)(fp, TIOCFLUSH, (caddr_t)&tmp, p); - goto out; - } - case _IO('S', 9): /* I_SETSIG */ - { - int on = 1; - - if (((int)SCARG(uap, data) & (SUNOS_S_HIPRI|SUNOS_S_INPUT)) == - SUNOS_S_HIPRI) { - error = EOPNOTSUPP; - goto out; - } - error = (*ctl)(fp, FIOASYNC, (caddr_t)&on, p); - goto out; - } - } - error = (sys_ioctl(p, uap, retval)); -out: - FRELE(fp); - return (error); -} - -/* SunOS fcntl(2) cmds not implemented */ -#define SUN_F_RGETLK 10 -#define SUN_F_RSETLK 11 -#define SUN_F_CNVT 12 -#define SUN_F_RSETLKW 13 - -/* SunOS flock translation */ -struct sunos_flock { - short l_type; - short l_whence; - long l_start; - long l_len; - short l_pid; - short l_xxx; -}; - -static void bsd_to_sunos_flock(struct flock *, struct sunos_flock *); -static void sunos_to_bsd_flock(struct sunos_flock *, struct flock *); - -#define SUNOS_F_RDLCK 1 -#define SUNOS_F_WRLCK 2 -#define SUNOS_F_UNLCK 3 - -static void -bsd_to_sunos_flock(iflp, oflp) - struct flock *iflp; - struct sunos_flock *oflp; -{ - switch (iflp->l_type) { - case F_RDLCK: - oflp->l_type = SUNOS_F_RDLCK; - break; - case F_WRLCK: - oflp->l_type = SUNOS_F_WRLCK; - break; - case F_UNLCK: - oflp->l_type = SUNOS_F_UNLCK; - break; - default: - oflp->l_type = -1; - break; - } - - oflp->l_whence = (short) iflp->l_whence; - oflp->l_start = (long) iflp->l_start; - oflp->l_len = (long) iflp->l_len; - oflp->l_pid = (short) iflp->l_pid; - oflp->l_xxx = 0; -} - - -static void -sunos_to_bsd_flock(iflp, oflp) - struct sunos_flock *iflp; - struct flock *oflp; -{ - switch (iflp->l_type) { - case SUNOS_F_RDLCK: - oflp->l_type = F_RDLCK; - break; - case SUNOS_F_WRLCK: - oflp->l_type = F_WRLCK; - break; - case SUNOS_F_UNLCK: - oflp->l_type = F_UNLCK; - break; - default: - oflp->l_type = -1; - break; - } - - oflp->l_whence = iflp->l_whence; - oflp->l_start = (off_t) iflp->l_start; - oflp->l_len = (off_t) iflp->l_len; - oflp->l_pid = (pid_t) iflp->l_pid; - -} -static struct { - long sun_flg; - long bsd_flg; -} sunfcntl_flgtab[] = { - /* F_[GS]ETFLags that differ: */ -#define SUN_FSETBLK 0x0010 -#define SUN_SHLOCK 0x0080 -#define SUN_EXLOCK 0x0100 -#define SUN_FNBIO 0x1000 -#define SUN_FSYNC 0x2000 -#define SUN_NONBLOCK 0x4000 -#define SUN_FNOCTTY 0x8000 - { SUN_NONBLOCK, O_NONBLOCK }, - { SUN_FNBIO, O_NONBLOCK }, - { SUN_SHLOCK, O_SHLOCK }, - { SUN_EXLOCK, O_EXLOCK }, - { SUN_FSYNC, O_SYNC }, - { SUN_FSETBLK, 0 }, - { SUN_FNOCTTY, 0 } -}; - -int -sunos_sys_fcntl(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_fcntl_args *uap = v; - long flg; - int n, ret; - - - switch (SCARG(uap, cmd)) { - case F_SETFL: - flg = (long)SCARG(uap, arg); - n = sizeof(sunfcntl_flgtab) / sizeof(sunfcntl_flgtab[0]); - while (--n >= 0) { - if (flg & sunfcntl_flgtab[n].sun_flg) { - flg &= ~sunfcntl_flgtab[n].sun_flg; - flg |= sunfcntl_flgtab[n].bsd_flg; - } - } - SCARG(uap, arg) = (void *)flg; - break; - - case F_GETLK: - case F_SETLK: - case F_SETLKW: - { - int error; - struct sunos_flock ifl; - struct flock *flp, fl; - caddr_t sg = stackgap_init(p->p_emul); - struct sys_fcntl_args fa; - - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = SCARG(uap, cmd); - - flp = stackgap_alloc(&sg, sizeof(struct flock)); - SCARG(&fa, arg) = (void *) flp; - - error = copyin(SCARG(uap, arg), &ifl, sizeof ifl); - if (error) - return error; - - sunos_to_bsd_flock(&ifl, &fl); - - error = copyout(&fl, flp, sizeof fl); - if (error) - return error; - - error = sys_fcntl(p, &fa, retval); - if (error || SCARG(&fa, cmd) != F_GETLK) - return error; - - error = copyin(flp, &fl, sizeof fl); - if (error) - return error; - - bsd_to_sunos_flock(&fl, &ifl); - - return copyout(&ifl, SCARG(uap, arg), sizeof ifl); - } - break; - case SUN_F_RGETLK: - case SUN_F_RSETLK: - case SUN_F_CNVT: - case SUN_F_RSETLKW: - return (EOPNOTSUPP); - - default: - break; - } - - ret = sys_fcntl(p, uap, retval); - - switch (SCARG(uap, cmd)) { - case F_GETFL: - n = sizeof(sunfcntl_flgtab) / sizeof(sunfcntl_flgtab[0]); - while (--n >= 0) { - if (ret & sunfcntl_flgtab[n].bsd_flg) { - ret &= ~sunfcntl_flgtab[n].bsd_flg; - ret |= sunfcntl_flgtab[n].sun_flg; - } - } - break; - default: - break; - } - - return (ret); -} diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c deleted file mode 100644 index 2b408a5e685..00000000000 --- a/sys/compat/sunos/sunos_misc.c +++ /dev/null @@ -1,1212 +0,0 @@ -/* $OpenBSD: sunos_misc.c,v 1.47 2009/07/09 22:29:55 thib Exp $ */ -/* $NetBSD: sunos_misc.c,v 1.65 1996/04/22 01:44:31 christos Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Lawrence Berkeley Laboratory. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)sunos_misc.c 8.1 (Berkeley) 6/18/93 - * - * Header: sunos_misc.c,v 1.16 93/04/07 02:46:27 torek Exp - */ - -/* - * SunOS compatibility module. - * - * SunOS 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/proc.h> -#include <sys/dirent.h> -#include <sys/file.h> -#include <sys/stat.h> -#include <sys/filedesc.h> -#include <sys/ioctl.h> -#include <sys/kernel.h> -#include <sys/reboot.h> -#include <sys/malloc.h> -#include <sys/mbuf.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/ptrace.h> -#include <sys/resource.h> -#include <sys/resourcevar.h> -#include <sys/signal.h> -#include <sys/signalvar.h> -#include <sys/socket.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 <sys/syscallargs.h> -#include <sys/conf.h> -#include <sys/socketvar.h> -#include <sys/times.h> - -#include <compat/sunos/sunos.h> -#include <compat/sunos/sunos_syscallargs.h> -#include <compat/sunos/sunos_util.h> -#include <compat/sunos/sunos_dirent.h> - -#include <compat/common/compat_dir.h> - -#include <netinet/in.h> - -#include <miscfs/specfs/specdev.h> - -#include <nfs/rpcv2.h> -#include <nfs/nfsproto.h> -#include <nfs/nfs.h> - -#include <uvm/uvm_extern.h> - -#ifdef sun3 -# include <machine/machdep.h> /* for prototype of reboot2() */ -#endif - -static int sunstatfs(struct statfs *, caddr_t); - -int -sunos_sys_wait4(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_wait4_args *uap = v; - if (SCARG(uap, pid) == 0) - SCARG(uap, pid) = WAIT_ANY; - return (sys_wait4(p, uap, retval)); -} - -int -sunos_sys_creat(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_creat_args *uap = v; - struct sys_open_args ouap; - - caddr_t sg = stackgap_init(p->p_emul); - SUNOS_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - SCARG(&ouap, path) = SCARG(uap, path); - SCARG(&ouap, flags) = O_WRONLY | O_CREAT | O_TRUNC; - SCARG(&ouap, mode) = SCARG(uap, mode); - - return (sys_open(p, &ouap, retval)); -} - -int -sunos_sys_access(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_access_args *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - SUNOS_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - return (sys_access(p, uap, retval)); -} - -int -sunos_sys_stat(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_stat_args *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - SUNOS_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - return (compat_43_sys_stat(p, uap, retval)); -} - -int -sunos_sys_lstat(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_lstat_args *uap = v; - caddr_t sg = stackgap_init(p->p_emul); - SUNOS_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - return (compat_43_sys_lstat(p, uap, retval)); -} - -int -sunos_sys_execve(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_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); - SUNOS_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 -sunos_sys_execv(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_execv_args *uap = v; - struct sys_execve_args ouap; - - caddr_t sg = stackgap_init(p->p_emul); - SUNOS_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - SCARG(&ouap, path) = SCARG(uap, path); - SCARG(&ouap, argp) = SCARG(uap, argp); - SCARG(&ouap, envp) = NULL; - - return (sys_execve(p, &ouap, retval)); -} - -int -sunos_sys_unmount(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_unmount_args *uap = v; - struct sys_unmount_args ouap; - - SCARG(&ouap, path) = SCARG(uap, path); - SCARG(&ouap, flags) = 0; - - return (sys_unmount(p, &ouap, retval)); -} - -/* - * Conversion table for SunOS NFS mount flags. - */ -static struct { - int sun_flg; - int bsd_flg; -} sunnfs_flgtab[] = { - { SUNNFS_SOFT, NFSMNT_SOFT }, - { SUNNFS_WSIZE, NFSMNT_WSIZE }, - { SUNNFS_RSIZE, NFSMNT_RSIZE }, - { SUNNFS_TIMEO, NFSMNT_TIMEO }, - { SUNNFS_RETRANS, NFSMNT_RETRANS }, - { SUNNFS_HOSTNAME, 0 }, /* Ignored */ - { SUNNFS_INT, NFSMNT_INT }, - { SUNNFS_NOAC, 0 }, /* Ignored */ - { SUNNFS_ACREGMIN, 0 }, /* Ignored */ - { SUNNFS_ACREGMAX, 0 }, /* Ignored */ - { SUNNFS_ACDIRMIN, 0 }, /* Ignored */ - { SUNNFS_ACDIRMAX, 0 }, /* Ignored */ - { SUNNFS_SECURE, 0 }, /* Ignored */ - { SUNNFS_NOCTO, 0 }, /* Ignored */ - { SUNNFS_POSIX, 0 } /* Ignored */ -}; - -int -sunos_sys_mount(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_mount_args *uap = v; - int oflags = SCARG(uap, flags), nflags, error; - char fsname[MFSNAMELEN]; - caddr_t sg = stackgap_init(p->p_emul); - - if (oflags & (SUNM_NOSUB | SUNM_SYS5)) - return (EINVAL); - if ((oflags & SUNM_NEWTYPE) == 0) - return (EINVAL); - nflags = 0; - if (oflags & SUNM_RDONLY) - nflags |= MNT_RDONLY; - if (oflags & SUNM_NOSUID) - nflags |= MNT_NOSUID; - if (oflags & SUNM_REMOUNT) - nflags |= MNT_UPDATE; - SCARG(uap, flags) = nflags; - - error = copyinstr((caddr_t)SCARG(uap, type), fsname, - sizeof fsname, (size_t *)0); - if (error) - return (error); - - if (strncmp(fsname, "4.2", sizeof fsname) == 0) { - SCARG(uap, type) = stackgap_alloc(&sg, sizeof("ffs")); - error = copyout("ffs", SCARG(uap, type), sizeof("ffs")); - if (error) - return (error); - } else if (strncmp(fsname, "nfs", sizeof fsname) == 0) { - struct sunos_nfs_args sna; - struct sockaddr_in sain; - struct nfs_args na; - struct sockaddr sa; - int n; - - error = copyin(SCARG(uap, data), &sna, sizeof sna); - if (error) - return (error); - error = copyin(sna.addr, &sain, sizeof sain); - if (error) - return (error); - bcopy(&sain, &sa, sizeof sa); - sa.sa_len = sizeof(sain); - SCARG(uap, data) = stackgap_alloc(&sg, sizeof(na)); - na.version = NFS_ARGSVERSION; - na.addr = stackgap_alloc(&sg, sizeof(struct sockaddr)); - na.addrlen = sizeof(struct sockaddr); - na.sotype = SOCK_DGRAM; - na.proto = IPPROTO_UDP; - na.fh = (void *)sna.fh; - na.fhsize = NFSX_V2FH; - na.flags = 0; - n = sizeof(sunnfs_flgtab) / sizeof(sunnfs_flgtab[0]); - while (--n >= 0) - if (sna.flags & sunnfs_flgtab[n].sun_flg) - na.flags |= sunnfs_flgtab[n].bsd_flg; - na.wsize = sna.wsize; - na.rsize = sna.rsize; - if (na.flags & NFSMNT_RSIZE) { - na.flags |= NFSMNT_READDIRSIZE; - na.readdirsize = na.rsize; - } - na.timeo = sna.timeo; - na.retrans = sna.retrans; - na.hostname = sna.hostname; - - error = copyout(&sa, na.addr, sizeof sa); - if (error) - return (error); - error = copyout(&na, SCARG(uap, data), sizeof na); - if (error) - return (error); - } - return (sys_mount(p, (struct sys_mount_args *)uap, retval)); -} - -#if defined(NFSCLIENT) -int -async_daemon(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sys_nfssvc_args ouap; - - SCARG(&ouap, flag) = NFSSVC_BIOD; - SCARG(&ouap, argp) = NULL; - - return (sys_nfssvc(p, &ouap, retval)); -} -#endif /* NFSCLIENT */ - -int -sunos_sys_sigpending(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_sigpending_args *uap = v; - int mask = p->p_siglist & p->p_sigmask; - - return (copyout((caddr_t)&mask, (caddr_t)SCARG(uap, mask), sizeof(int))); -} - -/* - * Read Sun-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 sunos_readdir_callback(void *, struct dirent *, off_t); - -struct sunos_readdir_callback_args { - caddr_t outp; - int resid; -}; - -int -sunos_readdir_callback(arg, bdp, cookie) - void *arg; - struct dirent *bdp; - off_t cookie; -{ - struct sunos_dirent idb; - struct sunos_readdir_callback_args *cb = arg; - int sunos_reclen; - int error; - - sunos_reclen = SUNOS_RECLEN(&idb, bdp->d_namlen); - if (cb->resid < sunos_reclen) - return (ENOMEM); - - idb.d_fileno = bdp->d_fileno; - idb.d_off = cookie; - idb.d_reclen = sunos_reclen; - idb.d_namlen = bdp->d_namlen; - strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); - - if ((error = copyout((caddr_t)&idb, cb->outp, sunos_reclen))) - return (error); - - cb->outp += sunos_reclen; - cb->resid -= sunos_reclen; - - return (0); -} - -int -sunos_sys_getdents(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_getdents_args /* { - syscallarg(int) fd; - syscallarg(char *) buf; - syscallarg(int) nbytes; - } */ *uap = v; - struct vnode *vp; - struct file *fp; - int error; - struct sunos_readdir_callback_args args; - - if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) - return (error); - - vp = (struct vnode *)fp->f_data; - /* SunOS returns ENOTDIR here, BSD would use EINVAL */ - if (vp->v_type != VDIR) { - error = ENOTDIR; - goto bad; - } - - args.resid = SCARG(uap, nbytes); - args.outp = (caddr_t)SCARG(uap, buf); - - error = readdir_with_callback(fp, &fp->f_offset, args.resid, - sunos_readdir_callback, &args); -bad: - FRELE(fp); - if (error) - return (error); - - *retval = SCARG(uap, nbytes) - args.resid; - - return (0); -} - - -#define SUNOS__MAP_NEW 0x80000000 /* if not, old mmap & cannot handle */ - -int -sunos_sys_mmap(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_mmap_args *uap = v; - struct sys_mmap_args ouap; - - /* - * Verify the arguments. - */ - if (SCARG(uap, prot) & ~(PROT_READ|PROT_WRITE|PROT_EXEC)) - return (EINVAL); /* XXX still needed? */ - - if ((SCARG(uap, flags) & SUNOS__MAP_NEW) == 0) - return (EINVAL); - - SCARG(&ouap, flags) = SCARG(uap, flags) & ~SUNOS__MAP_NEW; - SCARG(&ouap, addr) = SCARG(uap, addr); - - if ((SCARG(&ouap, flags) & MAP_FIXED) == 0 && - SCARG(&ouap, addr) != 0 && - SCARG(&ouap, addr) < (void *)round_page((vaddr_t)p->p_vmspace->vm_daddr+MAXDSIZ)) - SCARG(&ouap, addr) = (void *)round_page((vaddr_t)p->p_vmspace->vm_daddr+MAXDSIZ); - - SCARG(&ouap, len) = SCARG(uap, len); - SCARG(&ouap, prot) = SCARG(uap, prot); - SCARG(&ouap, fd) = SCARG(uap, fd); - SCARG(&ouap, pos) = SCARG(uap, pos); - - return (sys_mmap(p, &ouap, retval)); -} - -#define MC_SYNC 1 -#define MC_LOCK 2 -#define MC_UNLOCK 3 -#define MC_ADVISE 4 -#define MC_LOCKAS 5 -#define MC_UNLOCKAS 6 - -int -sunos_sys_mctl(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - register struct sunos_sys_mctl_args *uap = v; - - switch (SCARG(uap, func)) { - case MC_ADVISE: /* ignore for now */ - return (0); - case MC_SYNC: /* translate to msync */ - return (sys_msync(p, uap, retval)); - default: - return (EINVAL); - } -} - -int -sunos_sys_setsockopt(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_setsockopt_args *uap = v; - struct file *fp; - struct mbuf *m = NULL; - int error; - - if ((error = getsock(p->p_fd, SCARG(uap, s), &fp)) != 0) - return (error); -#define SO_DONTLINGER (~SO_LINGER) - if (SCARG(uap, name) == SO_DONTLINGER) { - m = m_get(M_WAIT, MT_SOOPTS); - mtod(m, struct linger *)->l_onoff = 0; - m->m_len = sizeof(struct linger); - error = (sosetopt((struct socket *)fp->f_data, SCARG(uap, level), - SO_LINGER, m)); - goto bad; - } - if (SCARG(uap, level) == IPPROTO_IP) { -#define SUNOS_IP_MULTICAST_IF 2 -#define SUNOS_IP_MULTICAST_TTL 3 -#define SUNOS_IP_MULTICAST_LOOP 4 -#define SUNOS_IP_ADD_MEMBERSHIP 5 -#define SUNOS_IP_DROP_MEMBERSHIP 6 - static int ipoptxlat[] = { - IP_MULTICAST_IF, - IP_MULTICAST_TTL, - IP_MULTICAST_LOOP, - IP_ADD_MEMBERSHIP, - IP_DROP_MEMBERSHIP - }; - if (SCARG(uap, name) >= SUNOS_IP_MULTICAST_IF && - SCARG(uap, name) <= SUNOS_IP_DROP_MEMBERSHIP) { - SCARG(uap, name) = - ipoptxlat[SCARG(uap, name) - SUNOS_IP_MULTICAST_IF]; - } - } - if (SCARG(uap, valsize) > MLEN) { - error = EINVAL; - goto bad; - } - if (SCARG(uap, val)) { - m = m_get(M_WAIT, MT_SOOPTS); - error = copyin(SCARG(uap, val), mtod(m, caddr_t), - (u_int)SCARG(uap, valsize)); - if (error) { - (void) m_free(m); - goto bad; - } - m->m_len = SCARG(uap, valsize); - } - error = (sosetopt((struct socket *)fp->f_data, SCARG(uap, level), - SCARG(uap, name), m)); -bad: - FRELE(fp); - return (error); -} - -int -sunos_sys_fchroot(p, v, retval) - register struct proc *p; - void *v; - register_t *retval; -{ - register struct sunos_sys_fchroot_args *uap = v; - register struct filedesc *fdp = p->p_fd; - register struct vnode *vp; - struct file *fp; - int error; - - if ((error = suser(p, 0)) != 0) - return (error); - if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0) - return (error); - vp = (struct vnode *)fp->f_data; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - if (vp->v_type != VDIR) - error = ENOTDIR; - else - error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p); - VOP_UNLOCK(vp, 0, p); - if (error) { - FRELE(fp); - return (error); - } - vref(vp); - if (fdp->fd_rdir != NULL) - vrele(fdp->fd_rdir); - fdp->fd_rdir = vp; - FRELE(fp); - return (0); -} - -/* - * XXX: This needs cleaning up. - */ -int -sunos_sys_auditsys(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - return 0; -} - -int -sunos_sys_uname(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_uname_args *uap = v; - struct sunos_utsname sut; - extern char machine[]; - - bzero(&sut, sizeof(sut)); - - 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, name), - sizeof(struct sunos_utsname)); -} - -int -sunos_sys_setpgrp(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_setpgrp_args *uap = v; - - /* - * difference to our setpgid call is to include backwards - * compatibility to pre-setsid() binaries. Do setsid() - * instead of setpgid() in those cases where the process - * tries to create a new session the old way. - */ - if (!SCARG(uap, pgid) && - (!SCARG(uap, pid) || SCARG(uap, pid) == p->p_pid)) - return sys_setsid(p, uap, retval); - else - return sys_setpgid(p, uap, retval); -} - -int -sunos_sys_open(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_open_args *uap = v; - int l, r; - int noctty; - int ret; - - caddr_t sg = stackgap_init(p->p_emul); - SUNOS_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - /* convert mode into NetBSD mode */ - l = SCARG(uap, flags); - noctty = l & 0x8000; - r = (l & (0x0001 | 0x0002 | 0x0008 | 0x0040 | 0x0200 | 0x0400 | 0x0800)); - r |= ((l & (0x0004 | 0x1000 | 0x4000)) ? O_NONBLOCK : 0); - r |= ((l & 0x0080) ? O_SHLOCK : 0); - r |= ((l & 0x0100) ? O_EXLOCK : 0); - r |= ((l & 0x2000) ? O_SYNC : 0); - - SCARG(uap, flags) = r; - ret = sys_open(p, (struct sys_open_args *)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); - /* ignore any error, just give it a try */ - if (fp->f_type == DTYPE_VNODE) - (fp->f_ops->fo_ioctl)(fp, TIOCSCTTY, (caddr_t)0, p); - FRELE(fp); - } - return ret; -} - -#if defined (NFSSERVER) -int -sunos_sys_nfssvc(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ -#if 0 - struct sunos_sys_nfssvc_args *uap = v; - struct emul *e = p->p_emul; - struct sys_nfssvc_args outuap; - struct sockaddr sa; - int error; - - bzero(&outuap, sizeof outuap); - SCARG(&outuap, fd) = SCARG(uap, fd); - SCARG(&outuap, mskval) = STACKGAPBASE; - SCARG(&outuap, msklen) = sizeof sa; - SCARG(&outuap, mtchval) = SCARG(&outuap, mskval) + sizeof sa; - SCARG(&outuap, mtchlen) = sizeof sa; - - bzero(&sa, sizeof sa); - if (error = copyout(&sa, SCARG(&outuap, mskval), SCARG(&outuap, msklen))) - return (error); - if (error = copyout(&sa, SCARG(&outuap, mtchval), SCARG(&outuap, mtchlen))) - return (error); - - return nfssvc(p, &outuap, retval); -#else - return (ENOSYS); -#endif -} -#endif /* NFSSERVER */ - -int -sunos_sys_ustat(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_ustat_args *uap = v; - struct sunos_ustat us; - int error; - - bzero(&us, sizeof us); - - /* - * XXX: should set f_tfree and f_tinode at least - * How do we translate dev -> fstat? (and then to sunos_ustat) - */ - - if ((error = copyout(&us, SCARG(uap, buf), sizeof us)) != 0) - return (error); - return 0; -} - -int -sunos_sys_quotactl(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - - return EINVAL; -} - -int -sunos_sys_vhangup(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct session *sp = p->p_session; - - if (sp->s_ttyvp == 0) - return 0; - - if (sp->s_ttyp && sp->s_ttyp->t_session == sp && sp->s_ttyp->t_pgrp) - pgsignal(sp->s_ttyp->t_pgrp, SIGHUP, 1); - - (void) ttywait(sp->s_ttyp); - if (sp->s_ttyvp) - VOP_REVOKE(sp->s_ttyvp, REVOKEALL); - if (sp->s_ttyvp) - vrele(sp->s_ttyvp); - sp->s_ttyvp = NULL; - - return 0; -} - -static int -sunstatfs(sp, buf) - struct statfs *sp; - caddr_t buf; -{ - struct sunos_statfs ssfs; - - bzero(&ssfs, sizeof ssfs); - ssfs.f_type = 0; - ssfs.f_bsize = sp->f_bsize; - ssfs.f_blocks = sp->f_blocks; - ssfs.f_bfree = sp->f_bfree; - ssfs.f_bavail = sp->f_bavail; - ssfs.f_files = sp->f_files; - ssfs.f_ffree = sp->f_ffree; - ssfs.f_fsid = sp->f_fsid; - return copyout((caddr_t)&ssfs, buf, sizeof ssfs); -} - -int -sunos_sys_statfs(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_statfs_args *uap = v; - register struct mount *mp; - register struct statfs *sp; - int error; - struct nameidata nd; - - caddr_t sg = stackgap_init(p->p_emul); - SUNOS_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 sunstatfs(sp, (caddr_t)SCARG(uap, buf)); -} - -int -sunos_sys_fstatfs(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_fstatfs_args *uap = v; - struct file *fp; - struct mount *mp; - 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 sunstatfs(sp, (caddr_t)SCARG(uap, buf)); -} - -int -sunos_sys_exportfs(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - /* - * XXX: should perhaps translate into a mount(2) - * with MOUNT_EXPORT? - */ - return 0; -} - -int -sunos_sys_mknod(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_mknod_args *uap = v; - - caddr_t sg = stackgap_init(p->p_emul); - SUNOS_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - - if (S_ISFIFO(SCARG(uap, mode))) - return sys_mkfifo(p, uap, retval); - - return sys_mknod(p, (struct sys_mknod_args *)uap, retval); -} - -#define SUNOS_SC_ARG_MAX 1 -#define SUNOS_SC_CHILD_MAX 2 -#define SUNOS_SC_CLK_TCK 3 -#define SUNOS_SC_NGROUPS_MAX 4 -#define SUNOS_SC_OPEN_MAX 5 -#define SUNOS_SC_JOB_CONTROL 6 -#define SUNOS_SC_SAVED_IDS 7 -#define SUNOS_SC_VERSION 8 - -int -sunos_sys_sysconf(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_sysconf_args *uap = v; - extern int maxfiles; - - switch(SCARG(uap, name)) { - case SUNOS_SC_ARG_MAX: - *retval = ARG_MAX; - break; - case SUNOS_SC_CHILD_MAX: - *retval = maxproc; - break; - case SUNOS_SC_CLK_TCK: - *retval = 60; /* should this be `hz', ie. 100? */ - break; - case SUNOS_SC_NGROUPS_MAX: - *retval = NGROUPS_MAX; - break; - case SUNOS_SC_OPEN_MAX: - *retval = maxfiles; - break; - case SUNOS_SC_JOB_CONTROL: - *retval = 1; - break; - case SUNOS_SC_SAVED_IDS: -#ifdef _POSIX_SAVED_IDS - *retval = 1; -#else - *retval = 0; -#endif - break; - case SUNOS_SC_VERSION: - *retval = 198808; - break; - default: - return EINVAL; - } - return 0; -} - -#define SUNOS_RLIMIT_NOFILE 6 /* Other RLIMIT_* are the same */ -#define SUNOS_RLIM_NLIMITS 7 - -int -sunos_sys_getrlimit(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_getrlimit_args *uap = v; - - if (SCARG(uap, which) >= SUNOS_RLIM_NLIMITS) - return EINVAL; - - if (SCARG(uap, which) == SUNOS_RLIMIT_NOFILE) - SCARG(uap, which) = RLIMIT_NOFILE; - - return compat_43_sys_getrlimit(p, uap, retval); -} - -int -sunos_sys_setrlimit(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_getrlimit_args *uap = v; - - if (SCARG(uap, which) >= SUNOS_RLIM_NLIMITS) - return EINVAL; - - if (SCARG(uap, which) == SUNOS_RLIMIT_NOFILE) - SCARG(uap, which) = RLIMIT_NOFILE; - - return compat_43_sys_setrlimit(p, uap, retval); -} - -#ifdef PTRACE - -static int sreq2breq[] = { - PT_TRACE_ME, PT_READ_I, PT_READ_D, -1, - PT_WRITE_I, PT_WRITE_D, -1, PT_CONTINUE, - PT_KILL, -1, PT_ATTACH, PT_DETACH, - PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS -}; -static int nreqs = sizeof(sreq2breq) / sizeof(sreq2breq[0]); - -int -sunos_sys_ptrace(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_ptrace_args *uap = v; - struct sys_ptrace_args pa; - int req; - - req = SCARG(uap, req); - - if (req < 0 || req >= nreqs) - return (EINVAL); - - req = sreq2breq[req]; - if (req == -1) - return (EINVAL); - - SCARG(&pa, req) = req; - SCARG(&pa, pid) = (pid_t)SCARG(uap, pid); - SCARG(&pa, addr) = (caddr_t)SCARG(uap, addr); - SCARG(&pa, data) = SCARG(uap, data); - - return sys_ptrace(p, &pa, retval); -} - -#endif /* PTRACE */ - -/* - * SunOS reboot system call (for compatibility). - * Sun lets you pass in a boot string which the PROM - * saves and provides to the next boot program. - */ -static struct sunos_howto_conv { - int sun_howto; - int bsd_howto; -} sunos_howto_conv[] = { - { 0x001, RB_ASKNAME }, - { 0x002, RB_SINGLE }, - { 0x004, RB_NOSYNC }, - { 0x008, RB_HALT }, - { 0x080, RB_DUMP }, - { 0x000, 0 }, -}; -#define SUNOS_RB_STRING 0x200 - -int -sunos_sys_reboot(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_reboot_args *uap = v; - struct sunos_howto_conv *convp; - int error, bsd_howto, sun_howto; - - if ((error = suser(p, 0)) != 0) - return (error); - - /* - * Convert howto bits to BSD format. - */ - sun_howto = SCARG(uap, howto); - bsd_howto = 0; - convp = sunos_howto_conv; - while (convp->sun_howto) { - if (sun_howto & convp->sun_howto) - bsd_howto |= convp->bsd_howto; - convp++; - } - -#ifdef sun3 - /* - * Sun RB_STRING (Get user supplied bootstring.) - * If the machine supports passing a string to the - * next booted kernel, add the machine name above - * and provide a reboot2() function (see sun3). - */ - if (sun_howto & SUNOS_RB_STRING) { - char bs[128]; - - error = copyinstr(SCARG(uap, bootstr), bs, sizeof(bs), 0); - if (error) - return error; - - return (reboot2(bsd_howto, bs)); - } -#endif /* sun3 */ - - boot(bsd_howto); - return 0; -} - -/* - * Generalized interface signal handler, 4.3-compatible. - */ -/* ARGSUSED */ -int -sunos_sys_sigvec(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - register struct sunos_sys_sigvec_args /* { - syscallarg(int) signum; - syscallarg(struct sigvec *) nsv; - syscallarg(struct sigvec *) osv; - } */ *uap = v; - struct sigvec vec; - register struct sigacts *ps = p->p_sigacts; - register struct sigvec *sv; - register int signum; - int bit, error; - - signum = SCARG(uap, signum); - if (signum <= 0 || signum >= NSIG || - signum == SIGKILL || signum == SIGSTOP) - return (EINVAL); - sv = &vec; - if (SCARG(uap, osv)) { - *(sig_t *)&sv->sv_handler = ps->ps_sigact[signum]; - sv->sv_mask = ps->ps_catchmask[signum]; - bit = sigmask(signum); - sv->sv_flags = 0; - if ((ps->ps_sigonstack & bit) != 0) - sv->sv_flags |= SV_ONSTACK; - if ((ps->ps_sigintr & bit) != 0) - sv->sv_flags |= SV_INTERRUPT; - if ((ps->ps_sigreset & bit) != 0) - sv->sv_flags |= SA_RESETHAND; - sv->sv_mask &= ~bit; - error = copyout((caddr_t)sv, (caddr_t)SCARG(uap, osv), - sizeof (vec)); - if (error) - return (error); - } - if (SCARG(uap, nsv)) { - error = copyin((caddr_t)SCARG(uap, nsv), (caddr_t)sv, - sizeof (vec)); - if (error) - return (error); - /* - * SunOS uses the mask 0x0004 as SV_RESETHAND - * meaning: `reset to SIG_DFL on delivery'. - * We support only the bits in: 0xF - * (those bits are the same as ours) - */ - if (sv->sv_flags & ~0xF) - return (EINVAL); - /* SunOS binaries have a user-mode trampoline. */ - sv->sv_flags |= SA_USERTRAMP; - /* Convert sigvec:SV_INTERRUPT to sigaction:SA_RESTART */ - sv->sv_flags ^= SA_RESTART; /* same bit, inverted */ - setsigvec(p, signum, (struct sigaction *)sv); - } - return (0); -} - -int -sunos_sys_ostime(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_ostime_args /* { - syscallarg(int) time; - } */ *uap = v; - struct timespec ts; - int error; - - if ((error = suser(p, 0)) != 0) - return (error); - - ts.tv_sec = SCARG(uap, time); - ts.tv_nsec = 0; - error = settime(&ts); - return (error); -} - -/* - * This code is partly stolen from src/lib/libc/gen/times.c - * XXX - CLK_TCK isn't declared in /sys, just in <time.h>, done here - */ - -#define CLK_TCK 100 -#define CONVTCK(r) (r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK)) - -int -sunos_sys_otimes(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sunos_sys_otimes_args /* { - syscallarg(struct tms *) tp; - } */ *uap = v; - struct tms tms; - struct rusage ru, *rup; - - /* RUSAGE_SELF */ - calcru(p, &ru.ru_utime, &ru.ru_stime, NULL); - tms.tms_utime = CONVTCK(ru.ru_utime); - tms.tms_stime = CONVTCK(ru.ru_stime); - - /* RUSAGE_CHILDREN */ - rup = &p->p_stats->p_cru; - tms.tms_cutime = CONVTCK(rup->ru_utime); - tms.tms_cstime = CONVTCK(rup->ru_stime); - - return copyout(&tms, SCARG(uap, tp), sizeof(*(SCARG(uap, tp)))); -} diff --git a/sys/compat/sunos/sunos_syscall.h b/sys/compat/sunos/sunos_syscall.h deleted file mode 100644 index b9ac3adaddd..00000000000 --- a/sys/compat/sunos/sunos_syscall.h +++ /dev/null @@ -1,447 +0,0 @@ -/* $OpenBSD: sunos_syscall.h,v 1.21 2008/01/05 00:38:13 miod Exp $ */ - -/* - * System call numbers. - * - * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.17 2008/01/05 00:36:13 miod Exp - */ - -/* syscall: "syscall" ret: "int" args: */ -#define SUNOS_SYS_syscall 0 - -/* syscall: "exit" ret: "int" args: "int" */ -#define SUNOS_SYS_exit 1 - -/* syscall: "fork" ret: "int" args: */ -#define SUNOS_SYS_fork 2 - -/* syscall: "read" ret: "int" args: "int" "char *" "u_int" */ -#define SUNOS_SYS_read 3 - -/* syscall: "write" ret: "int" args: "int" "char *" "u_int" */ -#define SUNOS_SYS_write 4 - -/* syscall: "open" ret: "int" args: "char *" "int" "int" */ -#define SUNOS_SYS_open 5 - -/* syscall: "close" ret: "int" args: "int" */ -#define SUNOS_SYS_close 6 - -/* syscall: "wait4" ret: "int" args: "int" "int *" "int" "struct rusage *" */ -#define SUNOS_SYS_wait4 7 - -/* syscall: "creat" ret: "int" args: "char *" "int" */ -#define SUNOS_SYS_creat 8 - -/* syscall: "link" ret: "int" args: "char *" "char *" */ -#define SUNOS_SYS_link 9 - -/* syscall: "unlink" ret: "int" args: "char *" */ -#define SUNOS_SYS_unlink 10 - -/* syscall: "execv" ret: "int" args: "char *" "char **" */ -#define SUNOS_SYS_execv 11 - -/* syscall: "chdir" ret: "int" args: "char *" */ -#define SUNOS_SYS_chdir 12 - - /* 13 is obsolete time */ -/* syscall: "mknod" ret: "int" args: "char *" "int" "int" */ -#define SUNOS_SYS_mknod 14 - -/* syscall: "chmod" ret: "int" args: "char *" "int" */ -#define SUNOS_SYS_chmod 15 - -/* syscall: "lchown" ret: "int" args: "char *" "int" "int" */ -#define SUNOS_SYS_lchown 16 - -/* syscall: "break" ret: "int" args: "char *" */ -#define SUNOS_SYS_break 17 - - /* 18 is obsolete stat */ -/* syscall: "lseek" ret: "long" args: "int" "long" "int" */ -#define SUNOS_SYS_lseek 19 - -/* syscall: "getpid" ret: "pid_t" args: */ -#define SUNOS_SYS_getpid 20 - - /* 21 is obsolete sunos_old_mount */ -/* syscall: "setuid" ret: "int" args: "uid_t" */ -#define SUNOS_SYS_setuid 23 - -/* syscall: "getuid" ret: "uid_t" args: */ -#define SUNOS_SYS_getuid 24 - -/* syscall: "ostime" ret: "int" args: "int" */ -#define SUNOS_SYS_ostime 25 - -/* syscall: "ptrace" ret: "long" args: "int" "pid_t" "caddr_t" "int" "char *" */ -#define SUNOS_SYS_ptrace 26 - -/* syscall: "access" ret: "int" args: "char *" "int" */ -#define SUNOS_SYS_access 33 - -/* syscall: "sync" ret: "int" args: */ -#define SUNOS_SYS_sync 36 - -/* syscall: "kill" ret: "int" args: "int" "int" */ -#define SUNOS_SYS_kill 37 - -/* syscall: "stat" ret: "int" args: "char *" "struct stat43 *" */ -#define SUNOS_SYS_stat 38 - -/* syscall: "lstat" ret: "int" args: "char *" "struct stat43 *" */ -#define SUNOS_SYS_lstat 40 - -/* syscall: "dup" ret: "int" args: "u_int" */ -#define SUNOS_SYS_dup 41 - -/* syscall: "opipe" ret: "int" args: */ -#define SUNOS_SYS_opipe 42 - -/* syscall: "otimes" ret: "int" args: "struct tms *" */ -#define SUNOS_SYS_otimes 43 - -/* syscall: "profil" ret: "int" args: "caddr_t" "u_int" "u_int" "u_int" */ -#define SUNOS_SYS_profil 44 - -/* syscall: "setgid" ret: "int" args: "uid_t" */ -#define SUNOS_SYS_setgid 46 - -/* syscall: "getgid" ret: "gid_t" args: */ -#define SUNOS_SYS_getgid 47 - -/* syscall: "acct" ret: "int" args: "char *" */ -#define SUNOS_SYS_acct 51 - -/* syscall: "mctl" ret: "int" args: "caddr_t" "int" "int" "void *" */ -#define SUNOS_SYS_mctl 53 - -/* syscall: "ioctl" ret: "int" args: "int" "u_long" "caddr_t" */ -#define SUNOS_SYS_ioctl 54 - -/* syscall: "reboot" ret: "int" args: "int" "char *" */ -#define SUNOS_SYS_reboot 55 - - /* 56 is obsolete sunos_owait3 */ -/* syscall: "symlink" ret: "int" args: "char *" "char *" */ -#define SUNOS_SYS_symlink 57 - -/* syscall: "readlink" ret: "int" args: "char *" "char *" "int" */ -#define SUNOS_SYS_readlink 58 - -/* syscall: "execve" ret: "int" args: "char *" "char **" "char **" */ -#define SUNOS_SYS_execve 59 - -/* syscall: "umask" ret: "int" args: "int" */ -#define SUNOS_SYS_umask 60 - -/* syscall: "chroot" ret: "int" args: "char *" */ -#define SUNOS_SYS_chroot 61 - -/* syscall: "fstat" ret: "int" args: "int" "struct stat43 *" */ -#define SUNOS_SYS_fstat 62 - -/* syscall: "getpagesize" ret: "int" args: */ -#define SUNOS_SYS_getpagesize 64 - -/* syscall: "msync" ret: "int" args: "void *" "size_t" "int" */ -#define SUNOS_SYS_msync 65 - -/* syscall: "vfork" ret: "int" args: */ -#define SUNOS_SYS_vfork 66 - - /* 67 is obsolete vread */ - /* 68 is obsolete vwrite */ -/* syscall: "sbrk" ret: "int" args: "int" */ -#define SUNOS_SYS_sbrk 69 - -/* syscall: "sstk" ret: "int" args: "int" */ -#define SUNOS_SYS_sstk 70 - -/* syscall: "mmap" ret: "int" args: "caddr_t" "size_t" "int" "int" "int" "long" */ -#define SUNOS_SYS_mmap 71 - - /* 72 is obsolete vadvise */ -/* syscall: "munmap" ret: "int" args: "caddr_t" "size_t" */ -#define SUNOS_SYS_munmap 73 - -/* syscall: "mprotect" ret: "int" args: "caddr_t" "size_t" "int" */ -#define SUNOS_SYS_mprotect 74 - -/* syscall: "madvise" ret: "int" args: "caddr_t" "size_t" "int" */ -#define SUNOS_SYS_madvise 75 - -/* syscall: "vhangup" ret: "int" args: */ -#define SUNOS_SYS_vhangup 76 - -/* syscall: "mincore" ret: "int" args: "caddr_t" "size_t" "char *" */ -#define SUNOS_SYS_mincore 78 - -/* syscall: "getgroups" ret: "int" args: "u_int" "gid_t *" */ -#define SUNOS_SYS_getgroups 79 - -/* syscall: "setgroups" ret: "int" args: "u_int" "gid_t *" */ -#define SUNOS_SYS_setgroups 80 - -/* syscall: "getpgrp" ret: "int" args: */ -#define SUNOS_SYS_getpgrp 81 - -/* syscall: "setpgrp" ret: "int" args: "int" "int" */ -#define SUNOS_SYS_setpgrp 82 - -/* syscall: "setitimer" ret: "int" args: "u_int" "struct itimerval *" "struct itimerval *" */ -#define SUNOS_SYS_setitimer 83 - -/* syscall: "swapon" ret: "int" args: "char *" */ -#define SUNOS_SYS_swapon 85 - -/* syscall: "getitimer" ret: "int" args: "u_int" "struct itimerval *" */ -#define SUNOS_SYS_getitimer 86 - -/* syscall: "gethostname" ret: "int" args: "char *" "u_int" */ -#define SUNOS_SYS_gethostname 87 - -/* syscall: "sethostname" ret: "int" args: "char *" "u_int" */ -#define SUNOS_SYS_sethostname 88 - -/* syscall: "getdtablesize" ret: "int" args: */ -#define SUNOS_SYS_getdtablesize 89 - -/* syscall: "dup2" ret: "int" args: "u_int" "u_int" */ -#define SUNOS_SYS_dup2 90 - -/* syscall: "fcntl" ret: "int" args: "int" "int" "void *" */ -#define SUNOS_SYS_fcntl 92 - -/* syscall: "select" ret: "int" args: "u_int" "fd_set *" "fd_set *" "fd_set *" "struct timeval *" */ -#define SUNOS_SYS_select 93 - -/* syscall: "fsync" ret: "int" args: "int" */ -#define SUNOS_SYS_fsync 95 - -/* syscall: "setpriority" ret: "int" args: "int" "int" "int" */ -#define SUNOS_SYS_setpriority 96 - -/* syscall: "socket" ret: "int" args: "int" "int" "int" */ -#define SUNOS_SYS_socket 97 - -/* syscall: "connect" ret: "int" args: "int" "caddr_t" "int" */ -#define SUNOS_SYS_connect 98 - -/* syscall: "accept" ret: "int" args: "int" "caddr_t" "int *" */ -#define SUNOS_SYS_accept 99 - -/* syscall: "getpriority" ret: "int" args: "int" "int" */ -#define SUNOS_SYS_getpriority 100 - -/* syscall: "send" ret: "int" args: "int" "caddr_t" "int" "int" */ -#define SUNOS_SYS_send 101 - -/* syscall: "recv" ret: "int" args: "int" "caddr_t" "int" "int" */ -#define SUNOS_SYS_recv 102 - -/* syscall: "bind" ret: "int" args: "int" "caddr_t" "int" */ -#define SUNOS_SYS_bind 104 - -/* syscall: "setsockopt" ret: "int" args: "int" "int" "int" "caddr_t" "int" */ -#define SUNOS_SYS_setsockopt 105 - -/* syscall: "listen" ret: "int" args: "int" "int" */ -#define SUNOS_SYS_listen 106 - -/* syscall: "sigvec" ret: "int" args: "int" "struct sigvec *" "struct sigvec *" */ -#define SUNOS_SYS_sigvec 108 - -/* syscall: "sigblock" ret: "int" args: "int" */ -#define SUNOS_SYS_sigblock 109 - -/* syscall: "sigsetmask" ret: "int" args: "int" */ -#define SUNOS_SYS_sigsetmask 110 - -/* syscall: "sigsuspend" ret: "int" args: "int" */ -#define SUNOS_SYS_sigsuspend 111 - -/* syscall: "sigstack" ret: "int" args: "struct sigstack *" "struct sigstack *" */ -#define SUNOS_SYS_sigstack 112 - -/* syscall: "recvmsg" ret: "int" args: "int" "struct omsghdr *" "int" */ -#define SUNOS_SYS_recvmsg 113 - -/* syscall: "sendmsg" ret: "int" args: "int" "caddr_t" "int" */ -#define SUNOS_SYS_sendmsg 114 - - /* 115 is obsolete vtrace */ -/* syscall: "gettimeofday" ret: "int" args: "struct timeval *" "struct timezone *" */ -#define SUNOS_SYS_gettimeofday 116 - -/* syscall: "getrusage" ret: "int" args: "int" "struct rusage *" */ -#define SUNOS_SYS_getrusage 117 - -/* syscall: "getsockopt" ret: "int" args: "int" "int" "int" "caddr_t" "int *" */ -#define SUNOS_SYS_getsockopt 118 - -/* syscall: "readv" ret: "int" args: "int" "struct iovec *" "u_int" */ -#define SUNOS_SYS_readv 120 - -/* syscall: "writev" ret: "int" args: "int" "struct iovec *" "u_int" */ -#define SUNOS_SYS_writev 121 - -/* syscall: "settimeofday" ret: "int" args: "struct timeval *" "struct timezone *" */ -#define SUNOS_SYS_settimeofday 122 - -/* syscall: "fchown" ret: "int" args: "int" "int" "int" */ -#define SUNOS_SYS_fchown 123 - -/* syscall: "fchmod" ret: "int" args: "int" "int" */ -#define SUNOS_SYS_fchmod 124 - -/* syscall: "recvfrom" ret: "int" args: "int" "caddr_t" "size_t" "int" "caddr_t" "int *" */ -#define SUNOS_SYS_recvfrom 125 - -/* syscall: "setreuid" ret: "int" args: "uid_t" "uid_t" */ -#define SUNOS_SYS_setreuid 126 - -/* syscall: "setregid" ret: "int" args: "gid_t" "gid_t" */ -#define SUNOS_SYS_setregid 127 - -/* syscall: "rename" ret: "int" args: "char *" "char *" */ -#define SUNOS_SYS_rename 128 - -/* syscall: "truncate" ret: "int" args: "char *" "long" */ -#define SUNOS_SYS_truncate 129 - -/* syscall: "ftruncate" ret: "int" args: "int" "long" */ -#define SUNOS_SYS_ftruncate 130 - -/* syscall: "flock" ret: "int" args: "int" "int" */ -#define SUNOS_SYS_flock 131 - -/* syscall: "sendto" ret: "int" args: "int" "caddr_t" "size_t" "int" "caddr_t" "int" */ -#define SUNOS_SYS_sendto 133 - -/* syscall: "shutdown" ret: "int" args: "int" "int" */ -#define SUNOS_SYS_shutdown 134 - -/* syscall: "socketpair" ret: "int" args: "int" "int" "int" "int *" */ -#define SUNOS_SYS_socketpair 135 - -/* syscall: "mkdir" ret: "int" args: "char *" "int" */ -#define SUNOS_SYS_mkdir 136 - -/* syscall: "rmdir" ret: "int" args: "char *" */ -#define SUNOS_SYS_rmdir 137 - -/* syscall: "utimes" ret: "int" args: "char *" "struct timeval *" */ -#define SUNOS_SYS_utimes 138 - -/* syscall: "sigreturn" ret: "int" args: "struct sigcontext *" */ -#define SUNOS_SYS_sigreturn 139 - -/* syscall: "adjtime" ret: "int" args: "struct timeval *" "struct timeval *" */ -#define SUNOS_SYS_adjtime 140 - -/* syscall: "getpeername" ret: "int" args: "int" "caddr_t" "int *" */ -#define SUNOS_SYS_getpeername 141 - -/* syscall: "gethostid" ret: "int" args: */ -#define SUNOS_SYS_gethostid 142 - -/* syscall: "getrlimit" ret: "int" args: "u_int" "struct orlimit *" */ -#define SUNOS_SYS_getrlimit 144 - -/* syscall: "setrlimit" ret: "int" args: "u_int" "struct orlimit *" */ -#define SUNOS_SYS_setrlimit 145 - -/* syscall: "killpg" ret: "int" args: "int" "int" */ -#define SUNOS_SYS_killpg 146 - -/* syscall: "getsockname" ret: "int" args: "int" "caddr_t" "int *" */ -#define SUNOS_SYS_getsockname 150 - -/* syscall: "poll" ret: "int" args: "struct pollfd *" "unsigned long" "int" */ -#define SUNOS_SYS_poll 153 - -/* syscall: "nfssvc" ret: "int" args: "int" */ -#define SUNOS_SYS_nfssvc 155 - -/* syscall: "getdirentries" ret: "int" args: "int" "char *" "u_int" "long *" */ -#define SUNOS_SYS_getdirentries 156 - -/* syscall: "statfs" ret: "int" args: "char *" "struct sunos_statfs *" */ -#define SUNOS_SYS_statfs 157 - -/* syscall: "fstatfs" ret: "int" args: "int" "struct sunos_statfs *" */ -#define SUNOS_SYS_fstatfs 158 - -/* syscall: "unmount" ret: "int" args: "char *" */ -#define SUNOS_SYS_unmount 159 - -/* syscall: "async_daemon" ret: "int" args: */ -#define SUNOS_SYS_async_daemon 160 - -/* syscall: "getfh" ret: "int" args: "char *" "fhandle_t *" */ -#define SUNOS_SYS_getfh 161 - -/* syscall: "getdomainname" ret: "int" args: "char *" "int" */ -#define SUNOS_SYS_getdomainname 162 - -/* syscall: "setdomainname" ret: "int" args: "char *" "int" */ -#define SUNOS_SYS_setdomainname 163 - -/* syscall: "quotactl" ret: "int" args: "int" "char *" "int" "caddr_t" */ -#define SUNOS_SYS_quotactl 165 - -/* syscall: "exportfs" ret: "int" args: "char *" "char *" */ -#define SUNOS_SYS_exportfs 166 - -/* syscall: "mount" ret: "int" args: "char *" "char *" "int" "caddr_t" */ -#define SUNOS_SYS_mount 167 - -/* syscall: "ustat" ret: "int" args: "int" "struct sunos_ustat *" */ -#define SUNOS_SYS_ustat 168 - -/* syscall: "semsys" ret: "int" args: "int" "int" "int" "int" "int" */ -#define SUNOS_SYS_semsys 169 - -/* syscall: "msgsys" ret: "int" args: "int" "int" "int" "int" "int" "int" */ -#define SUNOS_SYS_msgsys 170 - -/* syscall: "shmsys" ret: "int" args: "int" "int" "int" "int" */ -#define SUNOS_SYS_shmsys 171 - -/* syscall: "auditsys" ret: "int" args: "char *" */ -#define SUNOS_SYS_auditsys 172 - -/* syscall: "getdents" ret: "int" args: "int" "char *" "int" */ -#define SUNOS_SYS_getdents 174 - -/* syscall: "setsid" ret: "int" args: */ -#define SUNOS_SYS_setsid 175 - -/* syscall: "fchdir" ret: "int" args: "int" */ -#define SUNOS_SYS_fchdir 176 - -/* syscall: "fchroot" ret: "int" args: "int" */ -#define SUNOS_SYS_fchroot 177 - -/* syscall: "sigpending" ret: "int" args: "int *" */ -#define SUNOS_SYS_sigpending 183 - -/* syscall: "setpgid" ret: "int" args: "int" "int" */ -#define SUNOS_SYS_setpgid 185 - -/* syscall: "pathconf" ret: "long" args: "char *" "int" */ -#define SUNOS_SYS_pathconf 186 - -/* syscall: "fpathconf" ret: "long" args: "int" "int" */ -#define SUNOS_SYS_fpathconf 187 - -/* syscall: "sysconf" ret: "int" args: "int" */ -#define SUNOS_SYS_sysconf 188 - -/* syscall: "uname" ret: "int" args: "struct sunos_utsname *" */ -#define SUNOS_SYS_uname 189 - -#define SUNOS_SYS_MAXSYSCALL 190 diff --git a/sys/compat/sunos/sunos_syscallargs.h b/sys/compat/sunos/sunos_syscallargs.h deleted file mode 100644 index 282fbed3cb8..00000000000 --- a/sys/compat/sunos/sunos_syscallargs.h +++ /dev/null @@ -1,393 +0,0 @@ -/* $OpenBSD: sunos_syscallargs.h,v 1.22 2008/01/05 00:38:13 miod Exp $ */ - -/* - * System call argument lists. - * - * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.17 2008/01/05 00:36:13 miod 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 sunos_sys_open_args { - syscallarg(char *) path; - syscallarg(int) flags; - syscallarg(int) mode; -}; - -struct sunos_sys_wait4_args { - syscallarg(int) pid; - syscallarg(int *) status; - syscallarg(int) options; - syscallarg(struct rusage *) rusage; -}; - -struct sunos_sys_creat_args { - syscallarg(char *) path; - syscallarg(int) mode; -}; - -struct sunos_sys_execv_args { - syscallarg(char *) path; - syscallarg(char **) argp; -}; - -struct sunos_sys_mknod_args { - syscallarg(char *) path; - syscallarg(int) mode; - syscallarg(int) dev; -}; - -struct sunos_sys_ostime_args { - syscallarg(int) time; -}; - -struct sunos_sys_ptrace_args { - syscallarg(int) req; - syscallarg(pid_t) pid; - syscallarg(caddr_t) addr; - syscallarg(int) data; - syscallarg(char *) addr2; -}; - -struct sunos_sys_access_args { - syscallarg(char *) path; - syscallarg(int) flags; -}; - -struct sunos_sys_stat_args { - syscallarg(char *) path; - syscallarg(struct stat43 *) ub; -}; - -struct sunos_sys_lstat_args { - syscallarg(char *) path; - syscallarg(struct stat43 *) ub; -}; - -struct sunos_sys_otimes_args { - syscallarg(struct tms *) tp; -}; - -struct sunos_sys_mctl_args { - syscallarg(caddr_t) addr; - syscallarg(int) len; - syscallarg(int) func; - syscallarg(void *) arg; -}; - -struct sunos_sys_ioctl_args { - syscallarg(int) fd; - syscallarg(u_long) com; - syscallarg(caddr_t) data; -}; - -struct sunos_sys_reboot_args { - syscallarg(int) howto; - syscallarg(char *) bootstr; -}; - -struct sunos_sys_execve_args { - syscallarg(char *) path; - syscallarg(char **) argp; - syscallarg(char **) envp; -}; - -struct sunos_sys_mmap_args { - syscallarg(caddr_t) addr; - syscallarg(size_t) len; - syscallarg(int) prot; - syscallarg(int) flags; - syscallarg(int) fd; - syscallarg(long) pos; -}; - -struct sunos_sys_setpgrp_args { - syscallarg(int) pid; - syscallarg(int) pgid; -}; - -struct sunos_sys_fcntl_args { - syscallarg(int) fd; - syscallarg(int) cmd; - syscallarg(void *) arg; -}; - -struct sunos_sys_setsockopt_args { - syscallarg(int) s; - syscallarg(int) level; - syscallarg(int) name; - syscallarg(caddr_t) val; - syscallarg(int) valsize; -}; - -struct sunos_sys_sigvec_args { - syscallarg(int) signum; - syscallarg(struct sigvec *) nsv; - syscallarg(struct sigvec *) osv; -}; - -struct sunos_sys_sigreturn_args { - syscallarg(struct sigcontext *) sigcntxp; -}; - -struct sunos_sys_getrlimit_args { - syscallarg(u_int) which; - syscallarg(struct orlimit *) rlp; -}; - -struct sunos_sys_setrlimit_args { - syscallarg(u_int) which; - syscallarg(struct orlimit *) rlp; -}; - -struct sunos_sys_nfssvc_args { - syscallarg(int) fd; -}; - -struct sunos_sys_statfs_args { - syscallarg(char *) path; - syscallarg(struct sunos_statfs *) buf; -}; - -struct sunos_sys_fstatfs_args { - syscallarg(int) fd; - syscallarg(struct sunos_statfs *) buf; -}; - -struct sunos_sys_unmount_args { - syscallarg(char *) path; -}; - -struct sunos_sys_quotactl_args { - syscallarg(int) cmd; - syscallarg(char *) special; - syscallarg(int) uid; - syscallarg(caddr_t) addr; -}; - -struct sunos_sys_exportfs_args { - syscallarg(char *) path; - syscallarg(char *) ex; -}; - -struct sunos_sys_mount_args { - syscallarg(char *) type; - syscallarg(char *) dir; - syscallarg(int) flags; - syscallarg(caddr_t) data; -}; - -struct sunos_sys_ustat_args { - syscallarg(int) dev; - syscallarg(struct sunos_ustat *) buf; -}; - -struct sunos_sys_auditsys_args { - syscallarg(char *) record; -}; - -struct sunos_sys_getdents_args { - syscallarg(int) fd; - syscallarg(char *) buf; - syscallarg(int) nbytes; -}; - -struct sunos_sys_fchroot_args { - syscallarg(int) fd; -}; - -struct sunos_sys_sigpending_args { - syscallarg(int *) mask; -}; - -struct sunos_sys_sysconf_args { - syscallarg(int) name; -}; - -struct sunos_sys_uname_args { - syscallarg(struct sunos_utsname *) name; -}; - -/* - * 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 sys_read(struct proc *, void *, register_t *); -int sys_write(struct proc *, void *, register_t *); -int sunos_sys_open(struct proc *, void *, register_t *); -int sys_close(struct proc *, void *, register_t *); -int sunos_sys_wait4(struct proc *, void *, register_t *); -int sunos_sys_creat(struct proc *, void *, register_t *); -int sys_link(struct proc *, void *, register_t *); -int sys_unlink(struct proc *, void *, register_t *); -int sunos_sys_execv(struct proc *, void *, register_t *); -int sys_chdir(struct proc *, void *, register_t *); -int sunos_sys_mknod(struct proc *, void *, register_t *); -int sys_chmod(struct proc *, void *, register_t *); -int sys_lchown(struct proc *, void *, register_t *); -int sys_obreak(struct proc *, void *, register_t *); -int compat_43_sys_lseek(struct proc *, void *, register_t *); -int sys_getpid(struct proc *, void *, register_t *); -int sys_setuid(struct proc *, void *, register_t *); -int sys_getuid(struct proc *, void *, register_t *); -int sunos_sys_ostime(struct proc *, void *, register_t *); -#ifdef PTRACE -int sunos_sys_ptrace(struct proc *, void *, register_t *); -#else -#endif -int sunos_sys_access(struct proc *, void *, register_t *); -int sys_sync(struct proc *, void *, register_t *); -int sys_kill(struct proc *, void *, register_t *); -int sunos_sys_stat(struct proc *, void *, register_t *); -int sunos_sys_lstat(struct proc *, void *, register_t *); -int sys_dup(struct proc *, void *, register_t *); -int sys_opipe(struct proc *, void *, register_t *); -int sunos_sys_otimes(struct proc *, void *, register_t *); -int sys_profil(struct proc *, void *, register_t *); -int sys_setgid(struct proc *, void *, register_t *); -int sys_getgid(struct proc *, void *, register_t *); -#ifdef ACCOUNTING -int sys_acct(struct proc *, void *, register_t *); -#else -#endif -int sunos_sys_mctl(struct proc *, void *, register_t *); -int sunos_sys_ioctl(struct proc *, void *, register_t *); -int sunos_sys_reboot(struct proc *, void *, register_t *); -int sys_symlink(struct proc *, void *, register_t *); -int sys_readlink(struct proc *, void *, register_t *); -int sunos_sys_execve(struct proc *, void *, register_t *); -int sys_umask(struct proc *, void *, register_t *); -int sys_chroot(struct proc *, void *, register_t *); -int compat_43_sys_fstat(struct proc *, void *, register_t *); -int compat_43_sys_getpagesize(struct proc *, void *, register_t *); -int sys_msync(struct proc *, void *, register_t *); -int sys_vfork(struct proc *, void *, register_t *); -int sys_sbrk(struct proc *, void *, register_t *); -int sys_sstk(struct proc *, void *, register_t *); -int sunos_sys_mmap(struct proc *, void *, register_t *); -int sys_munmap(struct proc *, void *, register_t *); -int sys_mprotect(struct proc *, void *, register_t *); -int sys_madvise(struct proc *, void *, register_t *); -int sunos_sys_vhangup(struct proc *, void *, register_t *); -int sys_mincore(struct proc *, void *, register_t *); -int sys_getgroups(struct proc *, void *, register_t *); -int sys_setgroups(struct proc *, void *, register_t *); -int sys_getpgrp(struct proc *, void *, register_t *); -int sunos_sys_setpgrp(struct proc *, void *, register_t *); -int sys_setitimer(struct proc *, void *, register_t *); -int compat_25_sys_swapon(struct proc *, void *, register_t *); -int sys_getitimer(struct proc *, void *, register_t *); -int compat_43_sys_gethostname(struct proc *, void *, register_t *); -int compat_43_sys_sethostname(struct proc *, void *, register_t *); -int compat_43_sys_getdtablesize(struct proc *, void *, register_t *); -int sys_dup2(struct proc *, void *, register_t *); -int sunos_sys_fcntl(struct proc *, void *, register_t *); -int sys_select(struct proc *, void *, register_t *); -int sys_fsync(struct proc *, void *, register_t *); -int sys_setpriority(struct proc *, void *, register_t *); -int sys_socket(struct proc *, void *, register_t *); -int sys_connect(struct proc *, void *, register_t *); -int compat_43_sys_accept(struct proc *, void *, register_t *); -int sys_getpriority(struct proc *, void *, register_t *); -int compat_43_sys_send(struct proc *, void *, register_t *); -int compat_43_sys_recv(struct proc *, void *, register_t *); -int sys_bind(struct proc *, void *, register_t *); -int sunos_sys_setsockopt(struct proc *, void *, register_t *); -int sys_listen(struct proc *, void *, register_t *); -int sunos_sys_sigvec(struct proc *, void *, register_t *); -int compat_43_sys_sigblock(struct proc *, void *, register_t *); -int compat_43_sys_sigsetmask(struct proc *, void *, register_t *); -int sys_sigsuspend(struct proc *, void *, register_t *); -int compat_43_sys_sigstack(struct proc *, void *, register_t *); -int compat_43_sys_recvmsg(struct proc *, void *, register_t *); -int compat_43_sys_sendmsg(struct proc *, void *, register_t *); -int sys_gettimeofday(struct proc *, void *, register_t *); -int sys_getrusage(struct proc *, void *, register_t *); -int sys_getsockopt(struct proc *, void *, register_t *); -int sys_readv(struct proc *, void *, register_t *); -int sys_writev(struct proc *, void *, register_t *); -int sys_settimeofday(struct proc *, void *, register_t *); -int sys_fchown(struct proc *, void *, register_t *); -int sys_fchmod(struct proc *, void *, register_t *); -int compat_43_sys_recvfrom(struct proc *, void *, register_t *); -int sys_setreuid(struct proc *, void *, register_t *); -int sys_setregid(struct proc *, void *, register_t *); -int sys_rename(struct proc *, void *, register_t *); -int compat_43_sys_truncate(struct proc *, void *, register_t *); -int compat_43_sys_ftruncate(struct proc *, void *, register_t *); -int sys_flock(struct proc *, void *, register_t *); -int sys_sendto(struct proc *, void *, register_t *); -int sys_shutdown(struct proc *, void *, register_t *); -int sys_socketpair(struct proc *, void *, register_t *); -int sys_mkdir(struct proc *, void *, register_t *); -int sys_rmdir(struct proc *, void *, register_t *); -int sys_utimes(struct proc *, void *, register_t *); -int sunos_sys_sigreturn(struct proc *, void *, register_t *); -int sys_adjtime(struct proc *, void *, register_t *); -int compat_43_sys_getpeername(struct proc *, void *, register_t *); -int compat_43_sys_gethostid(struct proc *, void *, register_t *); -int sunos_sys_getrlimit(struct proc *, void *, register_t *); -int sunos_sys_setrlimit(struct proc *, void *, register_t *); -int compat_43_sys_killpg(struct proc *, void *, register_t *); -int compat_43_sys_getsockname(struct proc *, void *, register_t *); -int sys_poll(struct proc *, void *, register_t *); -#ifdef NFSSERVER -int sunos_sys_nfssvc(struct proc *, void *, register_t *); -#else -#endif -int sys_getdirentries(struct proc *, void *, register_t *); -int sunos_sys_statfs(struct proc *, void *, register_t *); -int sunos_sys_fstatfs(struct proc *, void *, register_t *); -int sunos_sys_unmount(struct proc *, void *, register_t *); -#ifdef NFSCLIENT -int async_daemon(struct proc *, void *, register_t *); -int sys_getfh(struct proc *, void *, register_t *); -#else -#endif -int compat_09_sys_getdomainname(struct proc *, void *, register_t *); -int compat_09_sys_setdomainname(struct proc *, void *, register_t *); -int sunos_sys_quotactl(struct proc *, void *, register_t *); -int sunos_sys_exportfs(struct proc *, void *, register_t *); -int sunos_sys_mount(struct proc *, void *, register_t *); -int sunos_sys_ustat(struct proc *, void *, register_t *); -#ifdef SYSVSEM -int compat_10_sys_semsys(struct proc *, void *, register_t *); -#else -#endif -#ifdef SYSVMSG -int compat_10_sys_msgsys(struct proc *, void *, register_t *); -#else -#endif -#ifdef SYSVSHM -int compat_10_sys_shmsys(struct proc *, void *, register_t *); -#else -#endif -int sunos_sys_auditsys(struct proc *, void *, register_t *); -int sunos_sys_getdents(struct proc *, void *, register_t *); -int sys_setsid(struct proc *, void *, register_t *); -int sys_fchdir(struct proc *, void *, register_t *); -int sunos_sys_fchroot(struct proc *, void *, register_t *); -int sunos_sys_sigpending(struct proc *, void *, register_t *); -int sys_setpgid(struct proc *, void *, register_t *); -int sys_pathconf(struct proc *, void *, register_t *); -int sys_fpathconf(struct proc *, void *, register_t *); -int sunos_sys_sysconf(struct proc *, void *, register_t *); -int sunos_sys_uname(struct proc *, void *, register_t *); diff --git a/sys/compat/sunos/sunos_syscalls.c b/sys/compat/sunos/sunos_syscalls.c deleted file mode 100644 index 2c2c633c3dc..00000000000 --- a/sys/compat/sunos/sunos_syscalls.c +++ /dev/null @@ -1,230 +0,0 @@ -/* $OpenBSD: sunos_syscalls.c,v 1.21 2008/01/05 00:38:13 miod Exp $ */ - -/* - * System call names. - * - * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.17 2008/01/05 00:36:13 miod Exp - */ - -char *sunos_syscallnames[] = { - "syscall", /* 0 = syscall */ - "exit", /* 1 = exit */ - "fork", /* 2 = fork */ - "read", /* 3 = read */ - "write", /* 4 = write */ - "open", /* 5 = open */ - "close", /* 6 = close */ - "wait4", /* 7 = wait4 */ - "creat", /* 8 = creat */ - "link", /* 9 = link */ - "unlink", /* 10 = unlink */ - "execv", /* 11 = execv */ - "chdir", /* 12 = chdir */ - "#13 (obsolete time)", /* 13 = obsolete time */ - "mknod", /* 14 = mknod */ - "chmod", /* 15 = chmod */ - "lchown", /* 16 = lchown */ - "break", /* 17 = break */ - "#18 (obsolete stat)", /* 18 = obsolete stat */ - "lseek", /* 19 = lseek */ - "getpid", /* 20 = getpid */ - "#21 (obsolete sunos_old_mount)", /* 21 = obsolete sunos_old_mount */ - "#22 (unimplemented System V umount)", /* 22 = unimplemented System V umount */ - "setuid", /* 23 = setuid */ - "getuid", /* 24 = getuid */ - "ostime", /* 25 = ostime */ -#ifdef PTRACE - "ptrace", /* 26 = ptrace */ -#else - "#26 (unimplemented sunos_ptrace)", /* 26 = unimplemented sunos_ptrace */ -#endif - "#27 (unimplemented sunos_alarm)", /* 27 = unimplemented sunos_alarm */ - "#28 (unimplemented sunos_fstat)", /* 28 = unimplemented sunos_fstat */ - "#29 (unimplemented sunos_pause)", /* 29 = unimplemented sunos_pause */ - "#30 (unimplemented sunos_utime)", /* 30 = unimplemented sunos_utime */ - "#31 (unimplemented sunos_stty)", /* 31 = unimplemented sunos_stty */ - "#32 (unimplemented sunos_gtty)", /* 32 = unimplemented sunos_gtty */ - "access", /* 33 = access */ - "#34 (unimplemented sunos_nice)", /* 34 = unimplemented sunos_nice */ - "#35 (unimplemented sunos_ftime)", /* 35 = unimplemented sunos_ftime */ - "sync", /* 36 = sync */ - "kill", /* 37 = kill */ - "stat", /* 38 = stat */ - "#39 (unimplemented sunos_setpgrp)", /* 39 = unimplemented sunos_setpgrp */ - "lstat", /* 40 = lstat */ - "dup", /* 41 = dup */ - "opipe", /* 42 = opipe */ - "otimes", /* 43 = otimes */ - "profil", /* 44 = profil */ - "#45 (unimplemented)", /* 45 = unimplemented */ - "setgid", /* 46 = setgid */ - "getgid", /* 47 = getgid */ - "#48 (unimplemented sunos_ssig)", /* 48 = unimplemented sunos_ssig */ - "#49 (unimplemented reserved for USG)", /* 49 = unimplemented reserved for USG */ - "#50 (unimplemented reserved for USG)", /* 50 = unimplemented reserved for USG */ -#ifdef ACCOUNTING - "acct", /* 51 = acct */ -#else - "#51 (unimplemented acct)", /* 51 = unimplemented acct */ -#endif - "#52 (unimplemented)", /* 52 = unimplemented */ - "mctl", /* 53 = mctl */ - "ioctl", /* 54 = ioctl */ - "reboot", /* 55 = reboot */ - "#56 (obsolete sunos_owait3)", /* 56 = obsolete sunos_owait3 */ - "symlink", /* 57 = symlink */ - "readlink", /* 58 = readlink */ - "execve", /* 59 = execve */ - "umask", /* 60 = umask */ - "chroot", /* 61 = chroot */ - "fstat", /* 62 = fstat */ - "#63 (unimplemented)", /* 63 = unimplemented */ - "getpagesize", /* 64 = getpagesize */ - "msync", /* 65 = msync */ - "vfork", /* 66 = vfork */ - "#67 (obsolete vread)", /* 67 = obsolete vread */ - "#68 (obsolete vwrite)", /* 68 = obsolete vwrite */ - "sbrk", /* 69 = sbrk */ - "sstk", /* 70 = sstk */ - "mmap", /* 71 = mmap */ - "#72 (obsolete vadvise)", /* 72 = obsolete vadvise */ - "munmap", /* 73 = munmap */ - "mprotect", /* 74 = mprotect */ - "madvise", /* 75 = madvise */ - "vhangup", /* 76 = vhangup */ - "#77 (unimplemented vlimit)", /* 77 = unimplemented vlimit */ - "mincore", /* 78 = mincore */ - "getgroups", /* 79 = getgroups */ - "setgroups", /* 80 = setgroups */ - "getpgrp", /* 81 = getpgrp */ - "setpgrp", /* 82 = setpgrp */ - "setitimer", /* 83 = setitimer */ - "#84 (unimplemented { int sunos_sys_wait ( void ) ; })", /* 84 = unimplemented { int sunos_sys_wait ( void ) ; } */ - "swapon", /* 85 = swapon */ - "getitimer", /* 86 = getitimer */ - "gethostname", /* 87 = gethostname */ - "sethostname", /* 88 = sethostname */ - "getdtablesize", /* 89 = getdtablesize */ - "dup2", /* 90 = dup2 */ - "#91 (unimplemented getdopt)", /* 91 = unimplemented getdopt */ - "fcntl", /* 92 = fcntl */ - "select", /* 93 = select */ - "#94 (unimplemented setdopt)", /* 94 = unimplemented setdopt */ - "fsync", /* 95 = fsync */ - "setpriority", /* 96 = setpriority */ - "socket", /* 97 = socket */ - "connect", /* 98 = connect */ - "accept", /* 99 = accept */ - "getpriority", /* 100 = getpriority */ - "send", /* 101 = send */ - "recv", /* 102 = recv */ - "#103 (unimplemented old socketaddr)", /* 103 = unimplemented old socketaddr */ - "bind", /* 104 = bind */ - "setsockopt", /* 105 = setsockopt */ - "listen", /* 106 = listen */ - "#107 (unimplemented vtimes)", /* 107 = unimplemented vtimes */ - "sigvec", /* 108 = sigvec */ - "sigblock", /* 109 = sigblock */ - "sigsetmask", /* 110 = sigsetmask */ - "sigsuspend", /* 111 = sigsuspend */ - "sigstack", /* 112 = sigstack */ - "recvmsg", /* 113 = recvmsg */ - "sendmsg", /* 114 = sendmsg */ - "#115 (obsolete vtrace)", /* 115 = obsolete vtrace */ - "gettimeofday", /* 116 = gettimeofday */ - "getrusage", /* 117 = getrusage */ - "getsockopt", /* 118 = getsockopt */ - "#119 (unimplemented)", /* 119 = unimplemented */ - "readv", /* 120 = readv */ - "writev", /* 121 = writev */ - "settimeofday", /* 122 = settimeofday */ - "fchown", /* 123 = fchown */ - "fchmod", /* 124 = fchmod */ - "recvfrom", /* 125 = recvfrom */ - "setreuid", /* 126 = setreuid */ - "setregid", /* 127 = setregid */ - "rename", /* 128 = rename */ - "truncate", /* 129 = truncate */ - "ftruncate", /* 130 = ftruncate */ - "flock", /* 131 = flock */ - "#132 (unimplemented)", /* 132 = unimplemented */ - "sendto", /* 133 = sendto */ - "shutdown", /* 134 = shutdown */ - "socketpair", /* 135 = socketpair */ - "mkdir", /* 136 = mkdir */ - "rmdir", /* 137 = rmdir */ - "utimes", /* 138 = utimes */ - "sigreturn", /* 139 = sigreturn */ - "adjtime", /* 140 = adjtime */ - "getpeername", /* 141 = getpeername */ - "gethostid", /* 142 = gethostid */ - "#143 (unimplemented old sethostid)", /* 143 = unimplemented old sethostid */ - "getrlimit", /* 144 = getrlimit */ - "setrlimit", /* 145 = setrlimit */ - "killpg", /* 146 = killpg */ - "#147 (unimplemented)", /* 147 = unimplemented */ - "#148 (unimplemented)", /* 148 = unimplemented */ - "#149 (unimplemented)", /* 149 = unimplemented */ - "getsockname", /* 150 = getsockname */ - "#151 (unimplemented getmsg)", /* 151 = unimplemented getmsg */ - "#152 (unimplemented putmsg)", /* 152 = unimplemented putmsg */ - "poll", /* 153 = poll */ - "#154 (unimplemented)", /* 154 = unimplemented */ -#ifdef NFSSERVER - "nfssvc", /* 155 = nfssvc */ -#else - "#155 (unimplemented)", /* 155 = unimplemented */ -#endif - "getdirentries", /* 156 = getdirentries */ - "statfs", /* 157 = statfs */ - "fstatfs", /* 158 = fstatfs */ - "unmount", /* 159 = unmount */ -#ifdef NFSCLIENT - "async_daemon", /* 160 = async_daemon */ - "getfh", /* 161 = getfh */ -#else - "#160 (unimplemented)", /* 160 = unimplemented */ - "#161 (unimplemented)", /* 161 = unimplemented */ -#endif - "getdomainname", /* 162 = getdomainname */ - "setdomainname", /* 163 = setdomainname */ - "#164 (unimplemented rtschedule)", /* 164 = unimplemented rtschedule */ - "quotactl", /* 165 = quotactl */ - "exportfs", /* 166 = exportfs */ - "mount", /* 167 = mount */ - "ustat", /* 168 = ustat */ -#ifdef SYSVSEM - "semsys", /* 169 = semsys */ -#else - "#169 (unimplemented semsys)", /* 169 = unimplemented semsys */ -#endif -#ifdef SYSVMSG - "msgsys", /* 170 = msgsys */ -#else - "#170 (unimplemented msgsys)", /* 170 = unimplemented msgsys */ -#endif -#ifdef SYSVSHM - "shmsys", /* 171 = shmsys */ -#else - "#171 (unimplemented shmsys)", /* 171 = unimplemented shmsys */ -#endif - "auditsys", /* 172 = auditsys */ - "#173 (unimplemented rfssys)", /* 173 = unimplemented rfssys */ - "getdents", /* 174 = getdents */ - "setsid", /* 175 = setsid */ - "fchdir", /* 176 = fchdir */ - "fchroot", /* 177 = fchroot */ - "#178 (unimplemented vpixsys)", /* 178 = unimplemented vpixsys */ - "#179 (unimplemented aioread)", /* 179 = unimplemented aioread */ - "#180 (unimplemented aiowrite)", /* 180 = unimplemented aiowrite */ - "#181 (unimplemented aiowait)", /* 181 = unimplemented aiowait */ - "#182 (unimplemented aiocancel)", /* 182 = unimplemented aiocancel */ - "sigpending", /* 183 = sigpending */ - "#184 (unimplemented)", /* 184 = unimplemented */ - "setpgid", /* 185 = setpgid */ - "pathconf", /* 186 = pathconf */ - "fpathconf", /* 187 = fpathconf */ - "sysconf", /* 188 = sysconf */ - "uname", /* 189 = uname */ -}; diff --git a/sys/compat/sunos/sunos_sysent.c b/sys/compat/sunos/sunos_sysent.c deleted file mode 100644 index 51120fba4c0..00000000000 --- a/sys/compat/sunos/sunos_sysent.c +++ /dev/null @@ -1,440 +0,0 @@ -/* $OpenBSD: sunos_sysent.c,v 1.21 2008/01/05 00:38:13 miod Exp $ */ - -/* - * System call switch table. - * - * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.17 2008/01/05 00:36:13 miod 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/sunos/sunos.h> -#include <compat/sunos/sunos_syscallargs.h> - -#define s(type) sizeof(type) - -struct sysent sunos_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 sys_read_args), 0, - sys_read }, /* 3 = read */ - { 3, s(struct sys_write_args), 0, - sys_write }, /* 4 = write */ - { 3, s(struct sunos_sys_open_args), 0, - sunos_sys_open }, /* 5 = open */ - { 1, s(struct sys_close_args), 0, - sys_close }, /* 6 = close */ - { 4, s(struct sunos_sys_wait4_args), 0, - sunos_sys_wait4 }, /* 7 = wait4 */ - { 2, s(struct sunos_sys_creat_args), 0, - sunos_sys_creat }, /* 8 = creat */ - { 2, s(struct sys_link_args), 0, - sys_link }, /* 9 = link */ - { 1, s(struct sys_unlink_args), 0, - sys_unlink }, /* 10 = unlink */ - { 2, s(struct sunos_sys_execv_args), 0, - sunos_sys_execv }, /* 11 = execv */ - { 1, s(struct sys_chdir_args), 0, - sys_chdir }, /* 12 = chdir */ - { 0, 0, 0, - sys_nosys }, /* 13 = obsolete time */ - { 3, s(struct sunos_sys_mknod_args), 0, - sunos_sys_mknod }, /* 14 = mknod */ - { 2, s(struct sys_chmod_args), 0, - sys_chmod }, /* 15 = chmod */ - { 3, s(struct sys_lchown_args), 0, - sys_lchown }, /* 16 = lchown */ - { 1, s(struct sys_obreak_args), 0, - sys_obreak }, /* 17 = break */ - { 0, 0, 0, - sys_nosys }, /* 18 = obsolete stat */ - { 3, s(struct compat_43_sys_lseek_args), 0, - compat_43_sys_lseek }, /* 19 = lseek */ - { 0, 0, 0, - sys_getpid }, /* 20 = getpid */ - { 0, 0, 0, - sys_nosys }, /* 21 = obsolete sunos_old_mount */ - { 0, 0, 0, - sys_nosys }, /* 22 = unimplemented System V umount */ - { 1, s(struct sys_setuid_args), 0, - sys_setuid }, /* 23 = setuid */ - { 0, 0, 0, - sys_getuid }, /* 24 = getuid */ - { 1, s(struct sunos_sys_ostime_args), 0, - sunos_sys_ostime }, /* 25 = ostime */ -#ifdef PTRACE - { 5, s(struct sunos_sys_ptrace_args), 0, - sunos_sys_ptrace }, /* 26 = ptrace */ -#else - { 0, 0, 0, - sys_nosys }, /* 26 = unimplemented sunos_ptrace */ -#endif - { 0, 0, 0, - sys_nosys }, /* 27 = unimplemented sunos_alarm */ - { 0, 0, 0, - sys_nosys }, /* 28 = unimplemented sunos_fstat */ - { 0, 0, 0, - sys_nosys }, /* 29 = unimplemented sunos_pause */ - { 0, 0, 0, - sys_nosys }, /* 30 = unimplemented sunos_utime */ - { 0, 0, 0, - sys_nosys }, /* 31 = unimplemented sunos_stty */ - { 0, 0, 0, - sys_nosys }, /* 32 = unimplemented sunos_gtty */ - { 2, s(struct sunos_sys_access_args), 0, - sunos_sys_access }, /* 33 = access */ - { 0, 0, 0, - sys_nosys }, /* 34 = unimplemented sunos_nice */ - { 0, 0, 0, - sys_nosys }, /* 35 = unimplemented sunos_ftime */ - { 0, 0, 0, - sys_sync }, /* 36 = sync */ - { 2, s(struct sys_kill_args), 0, - sys_kill }, /* 37 = kill */ - { 2, s(struct sunos_sys_stat_args), 0, - sunos_sys_stat }, /* 38 = stat */ - { 0, 0, 0, - sys_nosys }, /* 39 = unimplemented sunos_setpgrp */ - { 2, s(struct sunos_sys_lstat_args), 0, - sunos_sys_lstat }, /* 40 = lstat */ - { 1, s(struct sys_dup_args), 0, - sys_dup }, /* 41 = dup */ - { 0, 0, 0, - sys_opipe }, /* 42 = opipe */ - { 1, s(struct sunos_sys_otimes_args), 0, - sunos_sys_otimes }, /* 43 = otimes */ - { 4, s(struct sys_profil_args), 0, - sys_profil }, /* 44 = profil */ - { 0, 0, 0, - sys_nosys }, /* 45 = unimplemented */ - { 1, s(struct sys_setgid_args), 0, - sys_setgid }, /* 46 = setgid */ - { 0, 0, 0, - sys_getgid }, /* 47 = getgid */ - { 0, 0, 0, - sys_nosys }, /* 48 = unimplemented sunos_ssig */ - { 0, 0, 0, - sys_nosys }, /* 49 = unimplemented reserved for USG */ - { 0, 0, 0, - sys_nosys }, /* 50 = unimplemented reserved for USG */ -#ifdef ACCOUNTING - { 1, s(struct sys_acct_args), 0, - sys_acct }, /* 51 = acct */ -#else - { 0, 0, 0, - sys_nosys }, /* 51 = unimplemented acct */ -#endif - { 0, 0, 0, - sys_nosys }, /* 52 = unimplemented */ - { 4, s(struct sunos_sys_mctl_args), 0, - sunos_sys_mctl }, /* 53 = mctl */ - { 3, s(struct sunos_sys_ioctl_args), 0, - sunos_sys_ioctl }, /* 54 = ioctl */ - { 2, s(struct sunos_sys_reboot_args), 0, - sunos_sys_reboot }, /* 55 = reboot */ - { 0, 0, 0, - sys_nosys }, /* 56 = obsolete sunos_owait3 */ - { 2, s(struct sys_symlink_args), 0, - sys_symlink }, /* 57 = symlink */ - { 3, s(struct sys_readlink_args), 0, - sys_readlink }, /* 58 = readlink */ - { 3, s(struct sunos_sys_execve_args), 0, - sunos_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 */ - { 2, s(struct compat_43_sys_fstat_args), 0, - compat_43_sys_fstat }, /* 62 = fstat */ - { 0, 0, 0, - sys_nosys }, /* 63 = unimplemented */ - { 0, 0, 0, - compat_43_sys_getpagesize }, /* 64 = getpagesize */ - { 3, s(struct sys_msync_args), 0, - sys_msync }, /* 65 = msync */ - { 0, 0, 0, - sys_vfork }, /* 66 = vfork */ - { 0, 0, 0, - sys_nosys }, /* 67 = obsolete vread */ - { 0, 0, 0, - sys_nosys }, /* 68 = obsolete vwrite */ - { 1, s(struct sys_sbrk_args), 0, - sys_sbrk }, /* 69 = sbrk */ - { 1, s(struct sys_sstk_args), 0, - sys_sstk }, /* 70 = sstk */ - { 6, s(struct sunos_sys_mmap_args), 0, - sunos_sys_mmap }, /* 71 = mmap */ - { 0, 0, 0, - sys_nosys }, /* 72 = obsolete vadvise */ - { 2, s(struct sys_munmap_args), 0, - sys_munmap }, /* 73 = munmap */ - { 3, s(struct sys_mprotect_args), 0, - sys_mprotect }, /* 74 = mprotect */ - { 3, s(struct sys_madvise_args), 0, - sys_madvise }, /* 75 = madvise */ - { 0, 0, 0, - sunos_sys_vhangup }, /* 76 = vhangup */ - { 0, 0, 0, - sys_nosys }, /* 77 = unimplemented vlimit */ - { 3, s(struct sys_mincore_args), 0, - sys_mincore }, /* 78 = mincore */ - { 2, s(struct sys_getgroups_args), 0, - sys_getgroups }, /* 79 = getgroups */ - { 2, s(struct sys_setgroups_args), 0, - sys_setgroups }, /* 80 = setgroups */ - { 0, 0, 0, - sys_getpgrp }, /* 81 = getpgrp */ - { 2, s(struct sunos_sys_setpgrp_args), 0, - sunos_sys_setpgrp }, /* 82 = setpgrp */ - { 3, s(struct sys_setitimer_args), 0, - sys_setitimer }, /* 83 = setitimer */ - { 0, 0, 0, - sys_nosys }, /* 84 = unimplemented { int sunos_sys_wait ( void ) ; } */ - { 1, s(struct compat_25_sys_swapon_args), 0, - compat_25_sys_swapon }, /* 85 = swapon */ - { 2, s(struct sys_getitimer_args), 0, - sys_getitimer }, /* 86 = getitimer */ - { 2, s(struct compat_43_sys_gethostname_args), 0, - compat_43_sys_gethostname }, /* 87 = gethostname */ - { 2, s(struct compat_43_sys_sethostname_args), 0, - compat_43_sys_sethostname }, /* 88 = sethostname */ - { 0, 0, 0, - compat_43_sys_getdtablesize }, /* 89 = getdtablesize */ - { 2, s(struct sys_dup2_args), 0, - sys_dup2 }, /* 90 = dup2 */ - { 0, 0, 0, - sys_nosys }, /* 91 = unimplemented getdopt */ - { 3, s(struct sunos_sys_fcntl_args), 0, - sunos_sys_fcntl }, /* 92 = fcntl */ - { 5, s(struct sys_select_args), 0, - sys_select }, /* 93 = select */ - { 0, 0, 0, - sys_nosys }, /* 94 = unimplemented setdopt */ - { 1, s(struct sys_fsync_args), 0, - sys_fsync }, /* 95 = fsync */ - { 3, s(struct sys_setpriority_args), 0, - sys_setpriority }, /* 96 = setpriority */ - { 3, s(struct sys_socket_args), 0, - sys_socket }, /* 97 = socket */ - { 3, s(struct sys_connect_args), 0, - sys_connect }, /* 98 = connect */ - { 3, s(struct compat_43_sys_accept_args), 0, - compat_43_sys_accept }, /* 99 = accept */ - { 2, s(struct sys_getpriority_args), 0, - sys_getpriority }, /* 100 = getpriority */ - { 4, s(struct compat_43_sys_send_args), 0, - compat_43_sys_send }, /* 101 = send */ - { 4, s(struct compat_43_sys_recv_args), 0, - compat_43_sys_recv }, /* 102 = recv */ - { 0, 0, 0, - sys_nosys }, /* 103 = unimplemented old socketaddr */ - { 3, s(struct sys_bind_args), 0, - sys_bind }, /* 104 = bind */ - { 5, s(struct sunos_sys_setsockopt_args), 0, - sunos_sys_setsockopt }, /* 105 = setsockopt */ - { 2, s(struct sys_listen_args), 0, - sys_listen }, /* 106 = listen */ - { 0, 0, 0, - sys_nosys }, /* 107 = unimplemented vtimes */ - { 3, s(struct sunos_sys_sigvec_args), 0, - sunos_sys_sigvec }, /* 108 = sigvec */ - { 1, s(struct compat_43_sys_sigblock_args), 0, - compat_43_sys_sigblock }, /* 109 = sigblock */ - { 1, s(struct compat_43_sys_sigsetmask_args), 0, - compat_43_sys_sigsetmask }, /* 110 = sigsetmask */ - { 1, s(struct sys_sigsuspend_args), 0, - sys_sigsuspend }, /* 111 = sigsuspend */ - { 2, s(struct compat_43_sys_sigstack_args), 0, - compat_43_sys_sigstack }, /* 112 = sigstack */ - { 3, s(struct compat_43_sys_recvmsg_args), 0, - compat_43_sys_recvmsg }, /* 113 = recvmsg */ - { 3, s(struct compat_43_sys_sendmsg_args), 0, - compat_43_sys_sendmsg }, /* 114 = sendmsg */ - { 0, 0, 0, - sys_nosys }, /* 115 = obsolete vtrace */ - { 2, s(struct sys_gettimeofday_args), 0, - sys_gettimeofday }, /* 116 = gettimeofday */ - { 2, s(struct sys_getrusage_args), 0, - sys_getrusage }, /* 117 = getrusage */ - { 5, s(struct sys_getsockopt_args), 0, - sys_getsockopt }, /* 118 = getsockopt */ - { 0, 0, 0, - sys_nosys }, /* 119 = unimplemented */ - { 3, s(struct sys_readv_args), 0, - sys_readv }, /* 120 = readv */ - { 3, s(struct sys_writev_args), 0, - sys_writev }, /* 121 = writev */ - { 2, s(struct sys_settimeofday_args), 0, - sys_settimeofday }, /* 122 = settimeofday */ - { 3, s(struct sys_fchown_args), 0, - sys_fchown }, /* 123 = fchown */ - { 2, s(struct sys_fchmod_args), 0, - sys_fchmod }, /* 124 = fchmod */ - { 6, s(struct compat_43_sys_recvfrom_args), 0, - compat_43_sys_recvfrom }, /* 125 = recvfrom */ - { 2, s(struct sys_setreuid_args), 0, - sys_setreuid }, /* 126 = setreuid */ - { 2, s(struct sys_setregid_args), 0, - sys_setregid }, /* 127 = setregid */ - { 2, s(struct sys_rename_args), 0, - sys_rename }, /* 128 = rename */ - { 2, s(struct compat_43_sys_truncate_args), 0, - compat_43_sys_truncate }, /* 129 = truncate */ - { 2, s(struct compat_43_sys_ftruncate_args), 0, - compat_43_sys_ftruncate }, /* 130 = ftruncate */ - { 2, s(struct sys_flock_args), 0, - sys_flock }, /* 131 = flock */ - { 0, 0, 0, - sys_nosys }, /* 132 = unimplemented */ - { 6, s(struct sys_sendto_args), 0, - sys_sendto }, /* 133 = sendto */ - { 2, s(struct sys_shutdown_args), 0, - sys_shutdown }, /* 134 = shutdown */ - { 4, s(struct sys_socketpair_args), 0, - sys_socketpair }, /* 135 = socketpair */ - { 2, s(struct sys_mkdir_args), 0, - sys_mkdir }, /* 136 = mkdir */ - { 1, s(struct sys_rmdir_args), 0, - sys_rmdir }, /* 137 = rmdir */ - { 2, s(struct sys_utimes_args), 0, - sys_utimes }, /* 138 = utimes */ - { 1, s(struct sunos_sys_sigreturn_args), 0, - sunos_sys_sigreturn }, /* 139 = sigreturn */ - { 2, s(struct sys_adjtime_args), 0, - sys_adjtime }, /* 140 = adjtime */ - { 3, s(struct compat_43_sys_getpeername_args), 0, - compat_43_sys_getpeername }, /* 141 = getpeername */ - { 0, 0, 0, - compat_43_sys_gethostid }, /* 142 = gethostid */ - { 0, 0, 0, - sys_nosys }, /* 143 = unimplemented old sethostid */ - { 2, s(struct sunos_sys_getrlimit_args), 0, - sunos_sys_getrlimit }, /* 144 = getrlimit */ - { 2, s(struct sunos_sys_setrlimit_args), 0, - sunos_sys_setrlimit }, /* 145 = setrlimit */ - { 2, s(struct compat_43_sys_killpg_args), 0, - compat_43_sys_killpg }, /* 146 = killpg */ - { 0, 0, 0, - sys_nosys }, /* 147 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 148 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 149 = unimplemented */ - { 3, s(struct compat_43_sys_getsockname_args), 0, - compat_43_sys_getsockname }, /* 150 = getsockname */ - { 0, 0, 0, - sys_nosys }, /* 151 = unimplemented getmsg */ - { 0, 0, 0, - sys_nosys }, /* 152 = unimplemented putmsg */ - { 3, s(struct sys_poll_args), 0, - sys_poll }, /* 153 = poll */ - { 0, 0, 0, - sys_nosys }, /* 154 = unimplemented */ -#ifdef NFSSERVER - { 1, s(struct sunos_sys_nfssvc_args), 0, - sunos_sys_nfssvc }, /* 155 = nfssvc */ -#else - { 0, 0, 0, - sys_nosys }, /* 155 = unimplemented */ -#endif - { 4, s(struct sys_getdirentries_args), 0, - sys_getdirentries }, /* 156 = getdirentries */ - { 2, s(struct sunos_sys_statfs_args), 0, - sunos_sys_statfs }, /* 157 = statfs */ - { 2, s(struct sunos_sys_fstatfs_args), 0, - sunos_sys_fstatfs }, /* 158 = fstatfs */ - { 1, s(struct sunos_sys_unmount_args), 0, - sunos_sys_unmount }, /* 159 = unmount */ -#ifdef NFSCLIENT - { 0, 0, 0, - async_daemon }, /* 160 = async_daemon */ - { 2, s(struct sys_getfh_args), 0, - sys_getfh }, /* 161 = getfh */ -#else - { 0, 0, 0, - sys_nosys }, /* 160 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 161 = unimplemented */ -#endif - { 2, s(struct compat_09_sys_getdomainname_args), 0, - compat_09_sys_getdomainname }, /* 162 = getdomainname */ - { 2, s(struct compat_09_sys_setdomainname_args), 0, - compat_09_sys_setdomainname }, /* 163 = setdomainname */ - { 0, 0, 0, - sys_nosys }, /* 164 = unimplemented rtschedule */ - { 4, s(struct sunos_sys_quotactl_args), 0, - sunos_sys_quotactl }, /* 165 = quotactl */ - { 2, s(struct sunos_sys_exportfs_args), 0, - sunos_sys_exportfs }, /* 166 = exportfs */ - { 4, s(struct sunos_sys_mount_args), 0, - sunos_sys_mount }, /* 167 = mount */ - { 2, s(struct sunos_sys_ustat_args), 0, - sunos_sys_ustat }, /* 168 = ustat */ -#ifdef SYSVSEM - { 5, s(struct compat_10_sys_semsys_args), 0, - compat_10_sys_semsys }, /* 169 = semsys */ -#else - { 0, 0, 0, - sys_nosys }, /* 169 = unimplemented semsys */ -#endif -#ifdef SYSVMSG - { 6, s(struct compat_10_sys_msgsys_args), 0, - compat_10_sys_msgsys }, /* 170 = msgsys */ -#else - { 0, 0, 0, - sys_nosys }, /* 170 = unimplemented msgsys */ -#endif -#ifdef SYSVSHM - { 4, s(struct compat_10_sys_shmsys_args), 0, - compat_10_sys_shmsys }, /* 171 = shmsys */ -#else - { 0, 0, 0, - sys_nosys }, /* 171 = unimplemented shmsys */ -#endif - { 1, s(struct sunos_sys_auditsys_args), 0, - sunos_sys_auditsys }, /* 172 = auditsys */ - { 0, 0, 0, - sys_nosys }, /* 173 = unimplemented rfssys */ - { 3, s(struct sunos_sys_getdents_args), 0, - sunos_sys_getdents }, /* 174 = getdents */ - { 0, 0, 0, - sys_setsid }, /* 175 = setsid */ - { 1, s(struct sys_fchdir_args), 0, - sys_fchdir }, /* 176 = fchdir */ - { 1, s(struct sunos_sys_fchroot_args), 0, - sunos_sys_fchroot }, /* 177 = fchroot */ - { 0, 0, 0, - sys_nosys }, /* 178 = unimplemented vpixsys */ - { 0, 0, 0, - sys_nosys }, /* 179 = unimplemented aioread */ - { 0, 0, 0, - sys_nosys }, /* 180 = unimplemented aiowrite */ - { 0, 0, 0, - sys_nosys }, /* 181 = unimplemented aiowait */ - { 0, 0, 0, - sys_nosys }, /* 182 = unimplemented aiocancel */ - { 1, s(struct sunos_sys_sigpending_args), 0, - sunos_sys_sigpending }, /* 183 = sigpending */ - { 0, 0, 0, - sys_nosys }, /* 184 = unimplemented */ - { 2, s(struct sys_setpgid_args), 0, - sys_setpgid }, /* 185 = setpgid */ - { 2, s(struct sys_pathconf_args), 0, - sys_pathconf }, /* 186 = pathconf */ - { 2, s(struct sys_fpathconf_args), 0, - sys_fpathconf }, /* 187 = fpathconf */ - { 1, s(struct sunos_sys_sysconf_args), 0, - sunos_sys_sysconf }, /* 188 = sysconf */ - { 1, s(struct sunos_sys_uname_args), 0, - sunos_sys_uname }, /* 189 = uname */ -}; - diff --git a/sys/compat/sunos/sunos_util.h b/sys/compat/sunos/sunos_util.h deleted file mode 100644 index b6a23dc5b74..00000000000 --- a/sys/compat/sunos/sunos_util.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: sunos_util.h,v 1.2 1996/08/02 20:35:34 niklas Exp $ */ -/* $NetBSD: sunos_util.h,v 1.2 1995/06/24 20:22:58 christos Exp $ */ - -/* - * Copyright (c) 1994 Christos Zoulas - * Copyright (c) 1995 Matthew Green - * 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 _SUNOS_UTIL_H_ -#define _SUNOS_UTIL_H_ - -#include <compat/common/compat_util.h> - -extern const char sunos_emul_path[]; - -#define SUNOS_CHECK_ALT_EXIST(p, sgp, path) \ - CHECK_ALT_EXIST(p, sgp, sunos_emul_path, path) - -#endif /* !_SUNOS_UTIL_H_ */ diff --git a/sys/compat/sunos/syscalls.conf b/sys/compat/sunos/syscalls.conf deleted file mode 100644 index 7595d1a20b2..00000000000 --- a/sys/compat/sunos/syscalls.conf +++ /dev/null @@ -1,12 +0,0 @@ -# $OpenBSD: syscalls.conf,v 1.3 2001/05/16 05:02:19 millert Exp $ -# $NetBSD: syscalls.conf,v 1.3 1995/04/27 12:05:43 christos Exp $ - -sysnames="sunos_syscalls.c" -sysnumhdr="sunos_syscall.h" -syssw="sunos_sysent.c" -sysarghdr="sunos_syscallargs.h" -libcompatopts="" - -switchname="sunos_sysent" -namesname="sunos_syscallnames" -constprefix="SUNOS_SYS_" diff --git a/sys/compat/sunos/syscalls.master b/sys/compat/sunos/syscalls.master deleted file mode 100644 index 08dc24dc39f..00000000000 --- a/sys/compat/sunos/syscalls.master +++ /dev/null @@ -1,314 +0,0 @@ - $OpenBSD: syscalls.master,v 1.17 2008/01/05 00:36:13 miod Exp $ -; $NetBSD: syscalls.master,v 1.33 1996/02/28 16:05:43 pk Exp $ - -; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 - -; OpenBSD COMPAT_SUNOS 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/sunos/sunos.h> -#include <compat/sunos/sunos_syscallargs.h> - -0 NOARGS { int sys_nosys(void); } syscall -1 NOARGS { int sys_exit(int rval); } -2 NOARGS { int sys_fork(void); } -3 NOARGS { int sys_read(int fd, char *buf, u_int nbyte); } -4 NOARGS { int sys_write(int fd, char *buf, u_int nbyte); } -5 STD { int sunos_sys_open(char *path, int flags, int mode); } -6 NOARGS { int sys_close(int fd); } -7 STD { int sunos_sys_wait4(int pid, int *status, \ - int options, struct rusage *rusage); } -8 STD { int sunos_sys_creat(char *path, int mode); } -9 NOARGS { int sys_link(char *path, char *link); } -10 NOARGS { int sys_unlink(char *path); } -11 STD { int sunos_sys_execv(char *path, char **argp); } -12 NOARGS { int sys_chdir(char *path); } -13 OBSOL time -14 STD { int sunos_sys_mknod(char *path, int mode, int dev); } -15 NOARGS { int sys_chmod(char *path, int mode); } -16 NOARGS { int sys_lchown(char *path, int uid, int gid); } -17 NOARGS { int sys_obreak(char *nsize); } break -18 OBSOL stat -19 NOARGS { long compat_43_sys_lseek(int fd, long offset, int whence); } -20 NOARGS { pid_t sys_getpid(void); } -21 OBSOL sunos_old_mount -22 UNIMPL System V umount -23 NOARGS { int sys_setuid(uid_t uid); } -24 NOARGS { uid_t sys_getuid(void); } -25 STD { int sunos_sys_ostime(int time); } -#ifdef PTRACE -26 STD { long sunos_sys_ptrace(int req, pid_t pid, \ - caddr_t addr, int data, char *addr2); } -#else -26 UNIMPL sunos_ptrace -#endif -27 UNIMPL sunos_alarm -28 UNIMPL sunos_fstat -29 UNIMPL sunos_pause -30 UNIMPL sunos_utime -31 UNIMPL sunos_stty -32 UNIMPL sunos_gtty -33 STD { int sunos_sys_access(char *path, int flags); } -34 UNIMPL sunos_nice -35 UNIMPL sunos_ftime -36 NOARGS { int sys_sync(void); } -37 NOARGS { int sys_kill(int pid, int signum); } -38 STD { int sunos_sys_stat(char *path, struct stat43 *ub); } -39 UNIMPL sunos_setpgrp -40 STD { int sunos_sys_lstat(char *path, struct stat43 *ub); } -41 NOARGS { int sys_dup(u_int fd); } -42 NOARGS { int sys_opipe(void); } -43 STD { int sunos_sys_otimes(struct tms *tp); } -44 NOARGS { int sys_profil(caddr_t samples, u_int size, \ - u_int offset, u_int scale); } -45 UNIMPL -46 NOARGS { int sys_setgid(uid_t gid); } -47 NOARGS { gid_t sys_getgid(void); } -48 UNIMPL sunos_ssig -49 UNIMPL reserved for USG -50 UNIMPL reserved for USG -#ifdef ACCOUNTING -51 NOARGS { int sys_acct(char *path); } -#else -51 UNIMPL acct -#endif -52 UNIMPL -53 STD { int sunos_sys_mctl(caddr_t addr, int len, int func, \ - void *arg); } -54 STD { int sunos_sys_ioctl(int fd, u_long com, \ - caddr_t data); } -55 STD { int sunos_sys_reboot(int howto, char *bootstr); } -56 OBSOL sunos_owait3 -57 NOARGS { int sys_symlink(char *path, char *link); } -58 NOARGS { int sys_readlink(char *path, char *buf, int count); } -59 STD { int sunos_sys_execve(char *path, char **argp, \ - char **envp); } -60 NOARGS { int sys_umask(int newmask); } -61 NOARGS { int sys_chroot(char *path); } -62 NOARGS { int compat_43_sys_fstat(int fd, struct stat43 *sb); } -63 UNIMPL -64 NOARGS { int compat_43_sys_getpagesize(void); } -65 NOARGS { int sys_msync(void *addr, size_t len, \ - int flags); } -66 NOARGS { int sys_vfork(void); } -67 OBSOL vread -68 OBSOL vwrite -69 NOARGS { int sys_sbrk(int incr); } -70 NOARGS { int sys_sstk(int incr); } -71 STD { int sunos_sys_mmap(caddr_t addr, size_t len, \ - int prot, int flags, int fd, long pos); } -72 OBSOL vadvise -73 NOARGS { int sys_munmap(caddr_t addr, size_t len); } -74 NOARGS { int sys_mprotect(caddr_t addr, size_t len, \ - int prot); } -75 NOARGS { int sys_madvise(caddr_t addr, size_t len, \ - int behav); } -76 STD { int sunos_sys_vhangup(void); } -77 UNIMPL vlimit -78 NOARGS { int sys_mincore(caddr_t addr, size_t len, \ - char *vec); } -79 NOARGS { int sys_getgroups(u_int gidsetsize, gid_t *gidset); } -80 NOARGS { int sys_setgroups(u_int gidsetsize, gid_t *gidset); } -81 NOARGS { int sys_getpgrp(void); } -82 STD { int sunos_sys_setpgrp(int pid, int pgid); } -83 NOARGS { int sys_setitimer(u_int which, \ - struct itimerval *itv, struct itimerval *oitv); } -84 UNIMPL { int sunos_sys_wait(void); } -85 NOARGS { int compat_25_sys_swapon(char *name); } -86 NOARGS { int sys_getitimer(u_int which, \ - struct itimerval *itv); } -87 NOARGS { int compat_43_sys_gethostname(char *hostname, \ - u_int len); } -88 NOARGS { int compat_43_sys_sethostname(char *hostname, \ - u_int len); } -89 NOARGS { int compat_43_sys_getdtablesize(void); } -90 NOARGS { int sys_dup2(u_int from, u_int to); } -91 UNIMPL getdopt -92 STD { int sunos_sys_fcntl(int fd, int cmd, void *arg); } -93 NOARGS { int sys_select(u_int nd, fd_set *in, fd_set *ou, \ - fd_set *ex, struct timeval *tv); } -94 UNIMPL setdopt -95 NOARGS { int sys_fsync(int fd); } -96 NOARGS { int sys_setpriority(int which, int who, int prio); } -97 NOARGS { int sys_socket(int domain, int type, int protocol); } -98 NOARGS { int sys_connect(int s, caddr_t name, int namelen); } -99 NOARGS { int compat_43_sys_accept(int s, caddr_t name, \ - int *anamelen); } -100 NOARGS { int sys_getpriority(int which, int who); } -101 NOARGS { int compat_43_sys_send(int s, caddr_t buf, int len, \ - int flags); } -102 NOARGS { int compat_43_sys_recv(int s, caddr_t buf, int len, \ - int flags); } -103 UNIMPL old socketaddr -104 NOARGS { int sys_bind(int s, caddr_t name, int namelen); } -105 STD { int sunos_sys_setsockopt(int s, int level, int name, \ - caddr_t val, int valsize); } -106 NOARGS { int sys_listen(int s, int backlog); } -107 UNIMPL vtimes -108 STD { int sunos_sys_sigvec(int signum, struct sigvec *nsv, \ - struct sigvec *osv); } -109 NOARGS { int compat_43_sys_sigblock(int mask); } -110 NOARGS { int compat_43_sys_sigsetmask(int mask); } -111 NOARGS { int sys_sigsuspend(int mask); } -112 NOARGS { int compat_43_sys_sigstack(struct sigstack *nss, \ - struct sigstack *oss); } -113 NOARGS { int compat_43_sys_recvmsg(int s, \ - struct omsghdr *msg, int flags); } -114 NOARGS { int compat_43_sys_sendmsg(int s, caddr_t msg, \ - int flags); } -115 OBSOL vtrace -116 NOARGS { int sys_gettimeofday(struct timeval *tp, \ - struct timezone *tzp); } -117 NOARGS { int sys_getrusage(int who, struct rusage *rusage); } -118 NOARGS { int sys_getsockopt(int s, int level, int name, \ - caddr_t val, int *avalsize); } -119 UNIMPL -120 NOARGS { int sys_readv(int fd, struct iovec *iovp, \ - u_int iovcnt); } -121 NOARGS { int sys_writev(int fd, struct iovec *iovp, \ - u_int iovcnt); } -122 NOARGS { int sys_settimeofday(struct timeval *tv, \ - struct timezone *tzp); } -123 NOARGS { int sys_fchown(int fd, int uid, int gid); } -124 NOARGS { int sys_fchmod(int fd, int mode); } -125 NOARGS { int compat_43_sys_recvfrom(int s, caddr_t buf, \ - size_t len, int flags, caddr_t from, \ - int *fromlenaddr); } -126 NOARGS { int sys_setreuid(uid_t ruid, uid_t euid); } -127 NOARGS { int sys_setregid(gid_t rgid, gid_t egid); } -128 NOARGS { int sys_rename(char *from, char *to); } -129 NOARGS { int compat_43_sys_truncate(char *path, long length); } -130 NOARGS { int compat_43_sys_ftruncate(int fd, long length); } -131 NOARGS { int sys_flock(int fd, int how); } -132 UNIMPL -133 NOARGS { int sys_sendto(int s, caddr_t buf, size_t len, \ - int flags, caddr_t to, int tolen); } -134 NOARGS { int sys_shutdown(int s, int how); } -135 NOARGS { int sys_socketpair(int domain, int type, \ - int protocol, int *rsv); } -136 NOARGS { int sys_mkdir(char *path, int mode); } -137 NOARGS { int sys_rmdir(char *path); } -138 NOARGS { int sys_utimes(char *path, struct timeval *tptr); } -139 STD { int sunos_sys_sigreturn(struct sigcontext *sigcntxp); } -140 NOARGS { int sys_adjtime(struct timeval *delta, \ - struct timeval *olddelta); } -141 NOARGS { int compat_43_sys_getpeername(int fdes, caddr_t asa, \ - int *alen); } -142 NOARGS { int compat_43_sys_gethostid(void); } -143 UNIMPL old sethostid -144 STD { int sunos_sys_getrlimit(u_int which, \ - struct orlimit *rlp); } -145 STD { int sunos_sys_setrlimit(u_int which, \ - struct orlimit *rlp); } -146 NOARGS { int compat_43_sys_killpg(int pgid, int signum); } -147 UNIMPL -148 UNIMPL -149 UNIMPL -150 NOARGS { int compat_43_sys_getsockname(int fdes, caddr_t asa, \ - int *alen); } -151 UNIMPL getmsg -152 UNIMPL putmsg -153 NOARGS { int sys_poll(struct pollfd *fds, \ - unsigned long nfds, int timeout); } -154 UNIMPL -#ifdef NFSSERVER -155 STD { int sunos_sys_nfssvc(int fd); } -#else -155 UNIMPL -#endif -156 NOARGS { int sys_getdirentries(int fd, char *buf, \ - u_int count, long *basep); } -157 STD { int sunos_sys_statfs(char *path, \ - struct sunos_statfs *buf); } -158 STD { int sunos_sys_fstatfs(int fd, \ - struct sunos_statfs *buf); } -159 STD { int sunos_sys_unmount(char *path); } -#ifdef NFSCLIENT -160 NOARGS { int async_daemon(void); } -161 NOARGS { int sys_getfh(char *fname, fhandle_t *fhp); } -#else -160 UNIMPL -161 UNIMPL -#endif -162 NOARGS { int compat_09_sys_getdomainname(char *domainname, \ - int len); } -163 NOARGS { int compat_09_sys_setdomainname(char *domainname, \ - int len); } -164 UNIMPL rtschedule -165 STD { int sunos_sys_quotactl(int cmd, char *special, \ - int uid, caddr_t addr); } -166 STD { int sunos_sys_exportfs(char *path, char *ex); } -167 STD { int sunos_sys_mount(char *type, char *dir, \ - int flags, caddr_t data); } -168 STD { int sunos_sys_ustat(int dev, \ - struct sunos_ustat *buf); } -#ifdef SYSVSEM -169 NOARGS { int compat_10_sys_semsys(int which, int a2, int a3, \ - int a4, int a5); } -#else -169 UNIMPL semsys -#endif -#ifdef SYSVMSG -170 NOARGS { int compat_10_sys_msgsys(int which, int a2, int a3, \ - int a4, int a5, int a6); } -#else -170 UNIMPL msgsys -#endif -#ifdef SYSVSHM -171 NOARGS { int compat_10_sys_shmsys(int which, int a2, int a3, \ - int a4); } -#else -171 UNIMPL shmsys -#endif -172 STD { int sunos_sys_auditsys(char *record); } -173 UNIMPL rfssys -174 STD { int sunos_sys_getdents(int fd, char *buf, \ - int nbytes); } -175 NOARGS { int sys_setsid(void); } -176 NOARGS { int sys_fchdir(int fd); } -177 STD { int sunos_sys_fchroot(int fd); } -178 UNIMPL vpixsys -179 UNIMPL aioread -180 UNIMPL aiowrite -181 UNIMPL aiowait -182 UNIMPL aiocancel -183 STD { int sunos_sys_sigpending(int *mask); } -184 UNIMPL -185 NOARGS { int sys_setpgid(int pid, int pgid); } -186 NOARGS { long sys_pathconf(char *path, int name); } -187 NOARGS { long sys_fpathconf(int fd, int name); } -188 STD { int sunos_sys_sysconf(int name); } -189 STD { int sunos_sys_uname(struct sunos_utsname *name); } |