From cb7a37b6ee34b24db066c84784faa2101b8894c3 Mon Sep 17 00:00:00 2001 From: niklas Date: Thu, 18 Apr 1996 21:21:26 +0000 Subject: [PATCH] Merge of NetBSD 960317 --- sys/compat/common/compat_util.c | 4 +- sys/compat/common/kern_resource_43.c | 8 +- sys/compat/common/kern_sig_43.c | 18 ++-- sys/compat/common/tty_43.c | 11 ++- sys/compat/common/uipc_syscalls_43.c | 24 ++--- sys/compat/common/vfs_syscalls_43.c | 16 ++-- sys/compat/linux/linux_audio.c | 2 + sys/compat/linux/linux_audio.h | 36 ++++++++ sys/compat/linux/linux_termios.c | 12 +-- sys/compat/linux/linux_termios.h | 3 +- sys/compat/osf1/osf1_mount.c | 5 +- sys/compat/sunos/sunos.h | 19 +++- sys/compat/sunos/sunos_exec.c | 11 ++- sys/compat/sunos/sunos_ioctl.c | 128 +++++++++++++++++++++++---- sys/compat/sunos/sunos_misc.c | 121 +++++++++++++++++-------- sys/compat/sunos/sunos_syscallargs.h | 10 ++- sys/compat/sunos/sunos_sysent.c | 6 +- sys/compat/sunos/syscalls.master | 5 +- sys/compat/svr4/svr4_conf.h | 41 +++++++++ sys/compat/svr4/svr4_net.c | 3 +- sys/compat/svr4/svr4_termios.c | 1 + sys/compat/ultrix/ultrix_fs.c | 10 ++- sys/compat/ultrix/ultrix_misc.c | 5 +- 23 files changed, 385 insertions(+), 114 deletions(-) create mode 100644 sys/compat/svr4/svr4_conf.h diff --git a/sys/compat/common/compat_util.c b/sys/compat/common/compat_util.c index 1334e216cd7..58425111887 100644 --- a/sys/compat/common/compat_util.c +++ b/sys/compat/common/compat_util.c @@ -1,4 +1,5 @@ -/* $NetBSD: compat_util.c,v 1.3 1995/10/22 08:20:44 mycroft Exp $ */ +/* $OpenBSD: compat_util.c,v 1.4 1996/04/18 21:21:32 niklas Exp $ */ +/* $NetBSD: compat_util.c,v 1.4 1996/03/14 19:31:45 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -156,7 +157,6 @@ emul_find(p, sgp, prefix, path, pbuf, cflag) free(buf, M_TEMP); } -done: vrele(nd.ni_vp); if (!cflag) vrele(ndroot.ni_vp); diff --git a/sys/compat/common/kern_resource_43.c b/sys/compat/common/kern_resource_43.c index 1fc2bdbb19f..53cc1fd5d2f 100644 --- a/sys/compat/common/kern_resource_43.c +++ b/sys/compat/common/kern_resource_43.c @@ -1,4 +1,5 @@ -/* $NetBSD: kern_resource_43.c,v 1.3 1995/10/07 06:26:28 mycroft Exp $ */ +/* $OpenBSD: kern_resource_43.c,v 1.2 1996/04/18 21:21:33 niklas Exp $ */ +/* $NetBSD: kern_resource_43.c,v 1.4 1996/03/14 19:31:46 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1991, 1993 @@ -93,8 +94,9 @@ compat_43_sys_setrlimit(p, v, retval) struct rlimit lim; int error; - if (error = copyin((caddr_t)SCARG(uap, rlp), (caddr_t)&olim, - sizeof (struct orlimit))) + error = copyin((caddr_t)SCARG(uap, rlp), (caddr_t)&olim, + sizeof (struct orlimit)); + if (error) return (error); lim.rlim_cur = olim.rlim_cur; lim.rlim_max = olim.rlim_max; diff --git a/sys/compat/common/kern_sig_43.c b/sys/compat/common/kern_sig_43.c index 9703ea59a5c..453096d6aa9 100644 --- a/sys/compat/common/kern_sig_43.c +++ b/sys/compat/common/kern_sig_43.c @@ -1,4 +1,5 @@ -/* $NetBSD: kern_sig_43.c,v 1.6 1996/01/04 22:23:01 jtc Exp $ */ +/* $OpenBSD: kern_sig_43.c,v 1.3 1996/04/18 21:21:34 niklas Exp $ */ +/* $NetBSD: kern_sig_43.c,v 1.7 1996/03/14 19:31:47 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 @@ -126,8 +127,9 @@ compat_43_sys_sigstack(p, v, retval) return (error); if (SCARG(uap, nss) == 0) return (0); - if (error = copyin((caddr_t)SCARG(uap, nss), (caddr_t)&ss, - sizeof (ss))) + error = copyin((caddr_t)SCARG(uap, nss), (caddr_t)&ss, + sizeof (ss)); + if (error) return (error); psp->ps_flags |= SAS_ALTSTACK; psp->ps_sigstk.ss_sp = ss.ss_sp; @@ -176,13 +178,15 @@ compat_43_sys_sigvec(p, v, retval) if (p->p_flag & P_NOCLDSTOP) sv->sv_flags |= SA_NOCLDSTOP; sv->sv_mask &= ~bit; - if (error = copyout((caddr_t)sv, (caddr_t)SCARG(uap, osv), - sizeof (vec))) + error = copyout((caddr_t)sv, (caddr_t)SCARG(uap, osv), + sizeof (vec)); + if (error) return (error); } if (SCARG(uap, nsv)) { - if (error = copyin((caddr_t)SCARG(uap, nsv), (caddr_t)sv, - sizeof (vec))) + error = copyin((caddr_t)SCARG(uap, nsv), (caddr_t)sv, + sizeof (vec)); + if (error) return (error); sv->sv_flags ^= SA_RESTART; /* opposite of SV_INTERRUPT */ setsigvec(p, signum, (struct sigaction *)sv); diff --git a/sys/compat/common/tty_43.c b/sys/compat/common/tty_43.c index 80069861d7b..6da912cc228 100644 --- a/sys/compat/common/tty_43.c +++ b/sys/compat/common/tty_43.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tty_43.c,v 1.1 1996/02/26 23:26:53 niklas Exp $ */ -/* $NetBSD: tty_43.c,v 1.2 1996/02/10 00:12:44 christos Exp $ */ +/* $OpenBSD: tty_43.c,v 1.2 1996/04/18 21:21:34 niklas Exp $ */ +/* $NetBSD: tty_43.c,v 1.3 1996/03/14 19:31:49 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1991, 1993 @@ -85,7 +85,12 @@ static int compatspcodes[] = { #define CLR(t, f) (t) &= ~(f) #define ISSET(t, f) ((t) & (f)) +int ttcompatgetflags __P((struct tty *)); +void ttcompatsetflags __P((struct tty *, struct termios *)); +void ttcompatsetlflags __P((struct tty *, struct termios *)); + /*ARGSUSED*/ +int ttcompat(tp, com, data, flag, p) register struct tty *tp; u_long com; @@ -315,6 +320,7 @@ ttcompatgetflags(tp) return (flags); } +void ttcompatsetflags(tp, t) register struct tty *tp; register struct termios *t; @@ -402,6 +408,7 @@ ttcompatsetflags(tp, t) t->c_cflag = cflag; } +void ttcompatsetlflags(tp, t) register struct tty *tp; register struct termios *t; diff --git a/sys/compat/common/uipc_syscalls_43.c b/sys/compat/common/uipc_syscalls_43.c index e9eaaefe5b1..6263b4e6b5e 100644 --- a/sys/compat/common/uipc_syscalls_43.c +++ b/sys/compat/common/uipc_syscalls_43.c @@ -1,5 +1,5 @@ -/* $OpenBSD: uipc_syscalls_43.c,v 1.2 1996/02/26 23:26:54 niklas Exp $ */ -/* $NetBSD: uipc_syscalls_43.c,v 1.4 1996/02/10 00:12:46 christos Exp $ */ +/* $OpenBSD: uipc_syscalls_43.c,v 1.3 1996/04/18 21:21:36 niklas Exp $ */ +/* $NetBSD: uipc_syscalls_43.c,v 1.5 1996/03/14 19:31:50 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1990, 1993 @@ -215,8 +215,9 @@ compat_43_sys_recvmsg(p, v, retval) struct iovec aiov[UIO_SMALLIOV], *iov; int error; - if (error = copyin((caddr_t)SCARG(uap, msg), (caddr_t)&msg, - sizeof (struct omsghdr))) + error = copyin((caddr_t)SCARG(uap, msg), (caddr_t)&msg, + sizeof (struct omsghdr)); + if (error) return (error); if ((u_int)msg.msg_iovlen >= UIO_SMALLIOV) { if ((u_int)msg.msg_iovlen >= UIO_MAXIOV) @@ -227,8 +228,9 @@ compat_43_sys_recvmsg(p, v, retval) } else iov = aiov; msg.msg_flags = SCARG(uap, flags) | MSG_COMPAT; - if (error = copyin((caddr_t)msg.msg_iov, (caddr_t)iov, - (unsigned)(msg.msg_iovlen * sizeof (struct iovec)))) + error = copyin((caddr_t)msg.msg_iov, (caddr_t)iov, + (unsigned)(msg.msg_iovlen * sizeof (struct iovec))); + if (error) goto done; msg.msg_iov = iov; error = recvit(p, SCARG(uap, s), &msg, @@ -286,8 +288,9 @@ compat_43_sys_sendmsg(p, v, retval) struct iovec aiov[UIO_SMALLIOV], *iov; int error; - if (error = copyin(SCARG(uap, msg), (caddr_t)&msg, - sizeof (struct omsghdr))) + error = copyin(SCARG(uap, msg), (caddr_t)&msg, + sizeof (struct omsghdr)); + if (error) return (error); if ((u_int)msg.msg_iovlen >= UIO_SMALLIOV) { if ((u_int)msg.msg_iovlen >= UIO_MAXIOV) @@ -297,8 +300,9 @@ compat_43_sys_sendmsg(p, v, retval) M_WAITOK); } else iov = aiov; - if (error = copyin((caddr_t)msg.msg_iov, (caddr_t)iov, - (unsigned)(msg.msg_iovlen * sizeof (struct iovec)))) + error = copyin((caddr_t)msg.msg_iov, (caddr_t)iov, + (unsigned)(msg.msg_iovlen * sizeof (struct iovec))); + if (error) goto done; msg.msg_flags = MSG_COMPAT; msg.msg_iov = iov; diff --git a/sys/compat/common/vfs_syscalls_43.c b/sys/compat/common/vfs_syscalls_43.c index b834a9eda84..64217ec87f4 100644 --- a/sys/compat/common/vfs_syscalls_43.c +++ b/sys/compat/common/vfs_syscalls_43.c @@ -1,4 +1,5 @@ -/* $NetBSD: vfs_syscalls_43.c,v 1.3 1995/10/07 06:26:31 mycroft Exp $ */ +/* $OpenBSD: vfs_syscalls_43.c,v 1.2 1996/04/18 21:21:36 niklas Exp $ */ +/* $NetBSD: vfs_syscalls_43.c,v 1.4 1996/03/14 19:31:52 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -62,10 +63,12 @@ #include #include +static void cvtstat __P((struct stat *, struct ostat *)); + /* * Convert from an old to a new stat structure. */ -static int +static void cvtstat(st, ost) struct stat *st; struct ostat *ost; @@ -112,7 +115,7 @@ compat_43_sys_stat(p, v, retval) NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, SCARG(uap, path), p); - if (error = namei(&nd)) + if ((error = namei(&nd)) != 0) return (error); error = vn_stat(nd.ni_vp, &sb, p); vput(nd.ni_vp); @@ -146,7 +149,7 @@ compat_43_sys_lstat(p, v, retval) NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p); - if (error = namei(&nd)) + if ((error = namei(&nd)) != 0) return (error); /* * For symbolic links, always return the attributes of its @@ -190,6 +193,7 @@ compat_43_sys_lstat(p, v, retval) * Return status information about a file descriptor. */ /* ARGSUSED */ +int compat_43_sys_fstat(p, v, retval) struct proc *p; void *v; @@ -375,7 +379,7 @@ compat_43_sys_getdirentries(p, v, retval) int error, eofflag, readcnt; long loff; - if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) + if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) return (EBADF); @@ -450,7 +454,7 @@ unionread: #ifdef UNION { - extern int (**union_vnodeop_p)(); + extern int (**union_vnodeop_p) __P((void *)); extern struct vnode *union_dircache __P((struct vnode *)); if ((SCARG(uap, count) == auio.uio_resid) && diff --git a/sys/compat/linux/linux_audio.c b/sys/compat/linux/linux_audio.c index 1e21e807a06..8e2bc234e4f 100644 --- a/sys/compat/linux/linux_audio.c +++ b/sys/compat/linux/linux_audio.c @@ -1,3 +1,5 @@ +/* $OpenBSD: linux_audio.c,v 1.2 1996/04/18 21:21:38 niklas Exp $ */ + #include #include #include diff --git a/sys/compat/linux/linux_audio.h b/sys/compat/linux/linux_audio.h index af3e79f6770..5edc22269ec 100644 --- a/sys/compat/linux/linux_audio.h +++ b/sys/compat/linux/linux_audio.h @@ -1,3 +1,39 @@ +/* $OpenBSD: linux_audio.h,v 1.2 1996/04/18 21:21:38 niklas Exp $ */ + +#define LINUX_IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ +#define LINUX_IOC_VOID 0x00000000 /* no parameters */ +#define LINUX_IOC_IN 0x40000000 /* copy in parameters */ +#define LINUX_IOC_OUT 0x80000000 /* copy out parameters */ +#define LINUX_IOC_INOUT (LINUX_IOC_IN | LINUX_IOC_OUT) +#define _LINUX_IOCTL(w,x,y,z) ((int)((w)|(((z)&LINUX_IOCPARM_MASK)<<16)|((x)<<8)|(y))) +#if 0 +#define _LINUX_IO(x,y) _LINUX_IOCTL(LINUX_IOC_VOID, x, y, 0) +#endif +#define _LINUX_IOR(x,y,t) _LINUX_IOCTL(LINUX_IOC_OUT, x, y, sizeof(t)) +#define _LINUX_IOW(x,y,t) _LINUX_IOCTL(LINUX_IOC_IN, x, y, sizeof(t)) +#define _LINUX_IOWR(x,y,t) _LINUX_IOCTL(LINUX_IOC_INOUT, x, y, sizeof(t)) + +#define LINUX_SNDCTL_DSP_RESET _LINUX_IO('P', 0) +#define LINUX_SNDCTL_DSP_SYNC _LINUX_IO('P', 1) +#define LINUX_SNDCTL_DSP_SPEED _LINUX_IOWR('P', 2, int) +#define LINUX_SNDCTL_DSP_STEREO _LINUX_IOWR('P', 3, int) +#define LINUX_SNDCTL_DSP_GETBLKSIZE _LINUX_IOWR('P', 4, int) +#define LINUX_SNDCTL_DSP_SETFMT _LINUX_IOWR('P', 5, int) +#define LINUX_SNDCTL_DSP_POST _LINUX_IO('P', 8) +#define LINUX_SNDCTL_DSP_SETFRAGMENT _LINUX_IOWR('P', 10, int) +#define LINUX_SNDCTL_DSP_GETFMTS _LINUX_IOR('P', 11, int) + +#define LINUX_AFMT_QUERY 0x00000000 /* Return current fmt */ +#define LINUX_AFMT_MU_LAW 0x00000001 +#define LINUX_AFMT_A_LAW 0x00000002 +#define LINUX_AFMT_IMA_ADPCM 0x00000004 +#define LINUX_AFMT_U8 0x00000008 +#define LINUX_AFMT_S16_LE 0x00000010 /* Little endian signed 16 */ +#define LINUX_AFMT_S16_BE 0x00000020 /* Big endian signed 16 */ +#define LINUX_AFMT_S8 0x00000040 +#define LINUX_AFMT_U16_LE 0x00000080 /* Little endian U16 */ +#define LINUX_AFMT_U16_BE 0x00000100 /* Big endian U16 */ +#define LINUX_AFMT_MPEG 0x00000200 /* MPEG (2) audio */ #define LINUX_IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ #define LINUX_IOC_VOID 0x00000000 /* no parameters */ #define LINUX_IOC_IN 0x40000000 /* copy in parameters */ diff --git a/sys/compat/linux/linux_termios.c b/sys/compat/linux/linux_termios.c index 11cacd510f8..947616cf79e 100644 --- a/sys/compat/linux/linux_termios.c +++ b/sys/compat/linux/linux_termios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_termios.c,v 1.2 1996/04/17 05:24:08 mickey Exp $ */ +/* $OpenBSD: linux_termios.c,v 1.3 1996/04/18 21:21:39 niklas Exp $ */ /* $NetBSD: linux_termios.c,v 1.3 1996/04/05 00:01:54 christos Exp $ */ /* @@ -62,16 +62,6 @@ static int linux_spmasks[] = { LINUX_B57600, LINUX_B115200, LINUX_B230400 }; - -static void linux_termio_to_bsd_termios __P((struct linux_termio *, - struct termios *)); -static void bsd_termios_to_linux_termio __P((struct termios *, - struct linux_termio *)); -static void linux_termios_to_bsd_termios __P((struct linux_termios *, - struct termios *)); -static void bsd_termios_to_linux_termios __P((struct termios *, - struct linux_termios *)); - /* * Deal with termio ioctl cruft. This doesn't look very good.. * XXX too much code duplication, obviously.. diff --git a/sys/compat/linux/linux_termios.h b/sys/compat/linux/linux_termios.h index be65628dc00..dec7c6ba8be 100644 --- a/sys/compat/linux/linux_termios.h +++ b/sys/compat/linux/linux_termios.h @@ -1,4 +1,5 @@ -/* $OpenBSD: linux_termios.h,v 1.2 1996/04/17 05:24:09 mickey Exp $ */ +/* $OpenBSD: linux_termios.h,v 1.3 1996/04/18 21:21:40 niklas Exp $ */ + #define LINUX_TCGETS _LINUX_IO('T', 1) #define LINUX_TCSETS _LINUX_IO('T', 2) #define LINUX_TCSETSW _LINUX_IO('T', 3) diff --git a/sys/compat/osf1/osf1_mount.c b/sys/compat/osf1/osf1_mount.c index b02a42bf700..ca7d6879adb 100644 --- a/sys/compat/osf1/osf1_mount.c +++ b/sys/compat/osf1/osf1_mount.c @@ -1,4 +1,5 @@ -/* $NetBSD: osf1_mount.c,v 1.5 1995/10/07 06:27:24 mycroft Exp $ */ +/* $OpenBSD: osf1_mount.c,v 1.2 1996/04/18 21:21:41 niklas Exp $ */ +/* $NetBSD: osf1_mount.c,v 1.6 1996/02/17 23:08:36 jtk Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -158,7 +159,7 @@ bsd2osf_statfs(bsfs, osfs) { bzero(osfs, sizeof (struct osf1_statfs)); - if (!strncmp(MOUNT_UFS, bsfs->f_fstypename, MFSNAMELEN)) + if (!strncmp(MOUNT_FFS, bsfs->f_fstypename, MFSNAMELEN)) osfs->f_type = OSF1_MOUNT_UFS; else if (!strncmp(MOUNT_NFS, bsfs->f_fstypename, MFSNAMELEN)) osfs->f_type = OSF1_MOUNT_NFS; diff --git a/sys/compat/sunos/sunos.h b/sys/compat/sunos/sunos.h index db93710d457..c72d9353b89 100644 --- a/sys/compat/sunos/sunos.h +++ b/sys/compat/sunos/sunos.h @@ -1,4 +1,5 @@ -/* $NetBSD: sunos.h,v 1.5 1995/10/09 16:54:48 mycroft Exp $ */ +/* $OpenBSD: sunos.h,v 1.2 1996/04/18 21:21:42 niklas Exp $ */ +/* $NetBSD: sunos.h,v 1.6 1996/02/18 14:46:28 pk Exp $ */ #define SUNM_RDONLY 0x01 /* mount fs read-only */ #define SUNM_NOSUID 0x02 /* mount fs with setuid disallowed */ @@ -25,6 +26,22 @@ struct sunos_nfs_args { 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 { diff --git a/sys/compat/sunos/sunos_exec.c b/sys/compat/sunos/sunos_exec.c index 3ed414feb97..7933b652b2d 100644 --- a/sys/compat/sunos/sunos_exec.c +++ b/sys/compat/sunos/sunos_exec.c @@ -1,4 +1,5 @@ -/* $NetBSD: sunos_exec.c,v 1.9 1995/06/25 14:15:08 briggs Exp $ */ +/* $OpenBSD: sunos_exec.c,v 1.4 1996/04/18 21:21:43 niklas Exp $ */ +/* $NetBSD: sunos_exec.c,v 1.10 1996/03/14 19:33:44 christos Exp $ */ /* * Copyright (c) 1993 Theo de Raadt @@ -62,6 +63,11 @@ #define sunos_exec_aout_prep_omagic exec_aout_prep_omagic #endif +int sunos_exec_aout_makecmds __P((struct proc *, struct exec_package *)); +int sunos_exec_aout_prep_zmagic __P((struct proc *, struct exec_package *)); +int sunos_exec_aout_prep_nmagic __P((struct proc *, struct exec_package *)); +int sunos_exec_aout_prep_omagic __P((struct proc *, struct exec_package *)); + extern int nsunos_sysent; extern struct sysent sunos_sysent[]; #ifdef SYSCALL_DEBUG @@ -152,7 +158,6 @@ sunos_exec_aout_prep_zmagic(p, epp) struct exec_package *epp; { struct exec *execp = epp->ep_hdr; - struct exec_vmcmd *ccmdp; epp->ep_taddr = SUNOS_N_TXTADDR(*execp, ZMAGIC); epp->ep_tsize = execp->a_text; @@ -202,7 +207,6 @@ sunos_exec_aout_prep_nmagic(p, epp) struct exec_package *epp; { struct exec *execp = epp->ep_hdr; - struct exec_vmcmd *ccmdp; long bsize, baddr; epp->ep_taddr = SUNOS_N_TXTADDR(*execp, NMAGIC); @@ -240,7 +244,6 @@ sunos_exec_aout_prep_omagic(p, epp) struct exec_package *epp; { struct exec *execp = epp->ep_hdr; - struct exec_vmcmd *ccmdp; long bsize, baddr; epp->ep_taddr = SUNOS_N_TXTADDR(*execp, OMAGIC); diff --git a/sys/compat/sunos/sunos_ioctl.c b/sys/compat/sunos/sunos_ioctl.c index 8d39e6d15a6..c3f775191ef 100644 --- a/sys/compat/sunos/sunos_ioctl.c +++ b/sys/compat/sunos/sunos_ioctl.c @@ -1,4 +1,5 @@ -/* $NetBSD: sunos_ioctl.c,v 1.21 1995/10/07 06:27:31 mycroft Exp $ */ +/* $OpenBSD: sunos_ioctl.c,v 1.4 1996/04/18 21:21:44 niklas Exp $ */ +/* $NetBSD: sunos_ioctl.c,v 1.23 1996/03/14 19:33:46 christos Exp $ */ /* * Copyright (c) 1993 Markus Wild. @@ -90,6 +91,11 @@ static u_long s2btab[] = { 38400, }; +static void stios2btios __P((struct sunos_termios *, struct termios *)); +static void btios2stios __P((struct termios *, struct sunos_termios *)); +static void stios2stio __P((struct sunos_termios *, struct sunos_termio *)); +static void stio2stios __P((struct sunos_termio *, struct sunos_termios *)); + /* * these two conversion functions have mostly been done * with some perl cut&paste, then handedited to comment @@ -233,6 +239,7 @@ btios2stios(bt, st) struct sunos_termios *st; { register u_long l, r; + int s; l = bt->c_iflag; r = ((l & IGNBRK) ? 0x00000001 : 0); @@ -323,9 +330,9 @@ btios2stios(bt, st) r |= ((l & PENDIN) ? 0x00004000 : 0); st->c_lflag = r; - l = ttspeedtab(bt->c_ospeed, sptab); - if (l >= 0) - st->c_cflag |= l; + 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; @@ -390,7 +397,7 @@ sunos_sys_ioctl(p, v, retval) struct sunos_sys_ioctl_args *uap = v; register struct filedesc *fdp = p->p_fd; register struct file *fp; - register int (*ctl)(); + register int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)); int error; if ( (unsigned)SCARG(uap, fd) >= fdp->fd_nfiles || @@ -548,14 +555,16 @@ sunos_sys_ioctl(p, v, retval) case _IOW('t', 32, int): { /* TIOCTCNTL */ int error, on; - if (error = copyin (SCARG(uap, data), (caddr_t)&on, sizeof (on))) + error = copyin (SCARG(uap, data), (caddr_t)&on, sizeof (on)); + if (error) return error; return (*ctl)(fp, TIOCUCNTL, (caddr_t)&on, p); } case _IOW('t', 33, int): { /* TIOCSIGNAL */ int error, sig; - if (error = copyin (SCARG(uap, data), (caddr_t)&sig, sizeof (sig))) + error = copyin (SCARG(uap, data), (caddr_t)&sig, sizeof (sig)); + if (error) return error; return (*ctl)(fp, TIOCSIG, (caddr_t)&sig, p); } @@ -565,15 +574,17 @@ sunos_sys_ioctl(p, v, retval) */ #define IFREQ_IN(a) { \ struct ifreq ifreq; \ - if (error = copyin (SCARG(uap, data), (caddr_t)&ifreq, sizeof (ifreq))) \ + error = copyin (SCARG(uap, data), (caddr_t)&ifreq, sizeof (ifreq)); \ + if (error) \ return error; \ return (*ctl)(fp, a, (caddr_t)&ifreq, p); \ } #define IFREQ_INOUT(a) { \ struct ifreq ifreq; \ - if (error = copyin (SCARG(uap, data), (caddr_t)&ifreq, sizeof (ifreq))) \ + error = copyin (SCARG(uap, data), (caddr_t)&ifreq, sizeof (ifreq)); \ + if (error) \ return error; \ - if (error = (*ctl)(fp, a, (caddr_t)&ifreq, p)) \ + if ((error = (*ctl)(fp, a, (caddr_t)&ifreq, p)) != 0) \ return error; \ return copyout ((caddr_t)&ifreq, SCARG(uap, data), sizeof (ifreq)); \ } @@ -658,10 +669,12 @@ sunos_sys_ioctl(p, v, retval) * 1. our sockaddr's are variable length, not always sizeof(sockaddr) * 2. this returns a name per protocol, ie. it returns two "lo0"'s */ - if (error = copyin (SCARG(uap, data), (caddr_t)&ifconf, - sizeof (ifconf))) + error = copyin (SCARG(uap, data), (caddr_t)&ifconf, + sizeof (ifconf)); + if (error) return error; - if (error = (*ctl)(fp, OSIOCGIFCONF, (caddr_t)&ifconf, p)) + error = (*ctl)(fp, OSIOCGIFCONF, (caddr_t)&ifconf, p); + if (error) return error; return copyout ((caddr_t)&ifconf, SCARG(uap, data), sizeof (ifconf)); @@ -676,7 +689,8 @@ sunos_sys_ioctl(p, v, retval) struct audio_info aui; struct sunos_audio_info sunos_aui; - if (error = (*ctl)(fp, AUDIO_GETINFO, (caddr_t)&aui, p)) + error = (*ctl)(fp, AUDIO_GETINFO, (caddr_t)&aui, p); + if (error) return error; sunos_aui.play = *(struct sunos_audio_prinfo *)&aui.play; @@ -708,8 +722,9 @@ sunos_sys_ioctl(p, v, retval) struct audio_info aui; struct sunos_audio_info sunos_aui; - if (error = copyin (SCARG(uap, data), (caddr_t)&sunos_aui, - sizeof (sunos_aui))) + error = copyin (SCARG(uap, data), (caddr_t)&sunos_aui, + sizeof (sunos_aui)); + if (error) return error; aui.play = *(struct audio_prinfo *)&sunos_aui.play; @@ -739,7 +754,8 @@ sunos_sys_ioctl(p, v, retval) sunos_aui.record.active != (u_char)~0) aui.record.pause = 1; - if (error = (*ctl)(fp, AUDIO_SETINFO, (caddr_t)&aui, p)) + error = (*ctl)(fp, AUDIO_SETINFO, (caddr_t)&aui, p); + if (error) return error; /* Return new state */ goto sunos_au_getinfo; @@ -793,3 +809,81 @@ sunos_sys_ioctl(p, v, retval) } return (sys_ioctl(p, uap, retval)); } + +/* 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 + +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_FSYNC }, + { 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 SUN_F_RGETLK: + case SUN_F_RSETLK: + case SUN_F_CNVT: + case SUN_F_RSETLKW: + return (EOPNOTSUPP); + + default: + } + + 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: + } + + return (ret); +} diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index 8d258513a26..1a8f9e5a4a9 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -1,4 +1,5 @@ -/* $NetBSD: sunos_misc.c,v 1.60 1996/01/05 16:53:14 pk Exp $ */ +/* $OpenBSD: sunos_misc.c,v 1.5 1996/04/18 21:21:45 niklas Exp $ */ +/* $NetBSD: sunos_misc.c,v 1.64 1996/03/14 19:33:47 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -57,7 +58,7 @@ #include #include #include -#include +#include #include #include #include @@ -81,6 +82,9 @@ #include #include #include +#include +#include +#include #include #include @@ -92,11 +96,14 @@ #include #include -#include +#include #include #include +static int sunstatfs __P((struct statfs *, caddr_t)); +static void sunos_pollscan __P((struct proc *, struct sunos_pollfd *, + int, register_t *)); int sunos_sys_wait4(p, v, retval) struct proc *p; @@ -218,6 +225,30 @@ sunos_sys_unmount(p, v, retval) 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; @@ -242,42 +273,60 @@ sunos_sys_mount(p, v, retval) nflags |= MNT_UPDATE; SCARG(uap, flags) = nflags; - if (error = copyinstr((caddr_t)SCARG(uap, type), fsname, - sizeof fsname, (size_t *)0)) + 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) = STACKGAPBASE; - if (error = copyout("ffs", SCARG(uap, type), 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; - if (error = copyin(SCARG(uap, data), &sna, sizeof sna)) + error = copyin(SCARG(uap, data), &sna, sizeof sna); + if (error) return (error); - if (error = copyin(sna.addr, &sain, sizeof sain)) + error = copyin(sna.addr, &sain, sizeof sain); + if (error) return (error); bcopy(&sain, &sa, sizeof sa); sa.sa_len = sizeof(sain); SCARG(uap, data) = STACKGAPBASE; - na.addr = (struct sockaddr *)((int)SCARG(uap, data) + sizeof na); + na.version = NFS_ARGSVERSION; + na.addr = (struct sockaddr *) + ((int)SCARG(uap, data) + sizeof na); na.addrlen = sizeof(struct sockaddr); na.sotype = SOCK_DGRAM; na.proto = IPPROTO_UDP; - na.fh = (nfsv2fh_t *)sna.fh; - na.flags = sna.flags; + 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; - if (error = copyout(&sa, na.addr, sizeof sa)) + error = copyout(&sa, na.addr, sizeof sa); + if (error) return (error); - if (error = copyout(&na, SCARG(uap, data), sizeof na)) + error = copyout(&na, SCARG(uap, data), sizeof na); + if (error) return (error); } return (sys_mount(p, (struct sys_mount_args *)uap, retval)); @@ -519,7 +568,7 @@ sunos_sys_setsockopt(p, v, retval) struct mbuf *m = NULL; int error; - if (error = getsock(p->p_fd, SCARG(uap, s), &fp)) + if ((error = getsock(p->p_fd, SCARG(uap, s), &fp)) != 0) return (error); #define SO_DONTLINGER (~SO_LINGER) if (SCARG(uap, name) == SO_DONTLINGER) { @@ -556,8 +605,9 @@ sunos_sys_setsockopt(p, v, retval) m = m_get(M_WAIT, MT_SOOPTS); if (m == NULL) return (ENOBUFS); - if (error = copyin(SCARG(uap, val), mtod(m, caddr_t), - (u_int)SCARG(uap, valsize))) { + error = copyin(SCARG(uap, val), mtod(m, caddr_t), + (u_int)SCARG(uap, valsize)); + if (error) { (void) m_free(m); return (error); } @@ -699,13 +749,13 @@ sunos_sys_nfssvc(p, v, retval) 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; -#if 0 bzero(&outuap, sizeof outuap); SCARG(&outuap, fd) = SCARG(uap, fd); SCARG(&outuap, mskval) = STACKGAPBASE; @@ -743,7 +793,7 @@ sunos_sys_ustat(p, v, retval) * How do we translate dev -> fstat? (and then to sunos_ustat) */ - if (error = copyout(&us, SCARG(uap, buf), sizeof us)) + if ((error = copyout(&us, SCARG(uap, buf), sizeof us)) != 0) return (error); return 0; } @@ -754,7 +804,6 @@ sunos_sys_quotactl(p, v, retval) void *v; register_t *retval; { - struct sunos_sys_quotactl_args *uap = v; return EINVAL; } @@ -765,7 +814,6 @@ sunos_sys_vhangup(p, v, retval) void *v; register_t *retval; { - struct sunos_vhangup_args *uap = v; struct session *sp = p->p_session; if (sp->s_ttyvp == 0) @@ -784,7 +832,7 @@ sunos_sys_vhangup(p, v, retval) return 0; } -static +static int sunstatfs(sp, buf) struct statfs *sp; caddr_t buf; @@ -819,12 +867,12 @@ sunos_sys_statfs(p, v, retval) SUNOS_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p); - if (error = namei(&nd)) + 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)) + 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)); @@ -842,11 +890,11 @@ sunos_sys_fstatfs(p, v, retval) register struct statfs *sp; int error; - if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) + 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; - if (error = VFS_STATFS(mp, sp, p)) + 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)); @@ -858,8 +906,6 @@ sunos_sys_exportfs(p, v, retval) void *v; register_t *retval; { - struct sunos_sys_exportfs_args *uap = v; - /* * XXX: should perhaps translate into a mount(2) * with MOUNT_EXPORT? @@ -990,6 +1036,7 @@ static int sreq2breq[] = { }; static int nreqs = sizeof(sreq2breq) / sizeof(sreq2breq[0]); +int sunos_sys_ptrace(p, v, retval) struct proc *p; void *v; @@ -1075,13 +1122,12 @@ sunos_sys_poll(p, v, retval) int msec = SCARG(uap, timeout); struct timeval atv; int timo; - u_int ni; int ncoll; extern int nselcoll, selwait; pl = (struct sunos_pollfd *) malloc(sz, M_TEMP, M_WAITOK); - if (error = copyin(SCARG(uap, fds), pl, sz)) + if ((error = copyin(SCARG(uap, fds), pl, sz)) != 0) goto bad; for (i = 0; i < SCARG(uap, nfds); i++) @@ -1136,7 +1182,7 @@ done: if (error == EWOULDBLOCK) error = 0; - if (error2 = copyout(pl, SCARG(uap, fds), sz)) + if ((error2 = copyout(pl, SCARG(uap, fds), sz)) != 0) error = error2; bad: @@ -1173,7 +1219,7 @@ sunos_sys_reboot(p, v, retval) struct sunos_howto_conv *convp; int error, bsd_howto, sun_howto; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) return (error); /* @@ -1206,7 +1252,8 @@ sunos_sys_reboot(p, v, retval) } #endif /* sun3 */ - return (boot(bsd_howto)); + boot(bsd_howto); + return 0; } /* @@ -1247,13 +1294,15 @@ sunos_sys_sigvec(p, v, retval) if ((ps->ps_sigreset & bit) != 0) sv->sv_flags |= SA_RESETHAND; sv->sv_mask &= ~bit; - if (error = copyout((caddr_t)sv, (caddr_t)SCARG(uap, osv), - sizeof (vec))) + error = copyout((caddr_t)sv, (caddr_t)SCARG(uap, osv), + sizeof (vec)); + if (error) return (error); } if (SCARG(uap, nsv)) { - if (error = copyin((caddr_t)SCARG(uap, nsv), (caddr_t)sv, - sizeof (vec))) + error = copyin((caddr_t)SCARG(uap, nsv), (caddr_t)sv, + sizeof (vec)); + if (error) return (error); /* * SunOS uses the mask 0x0004 as SV_RESETHAND diff --git a/sys/compat/sunos/sunos_syscallargs.h b/sys/compat/sunos/sunos_syscallargs.h index cf9f3da584b..d4a43b53f91 100644 --- a/sys/compat/sunos/sunos_syscallargs.h +++ b/sys/compat/sunos/sunos_syscallargs.h @@ -2,7 +2,7 @@ * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.32 1995/10/07 06:27:35 mycroft Exp + * created from OpenBSD */ #define syscallarg(x) union { x datum; register_t pad; } @@ -97,6 +97,12 @@ struct sunos_sys_setpgrp_args { 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; @@ -268,7 +274,7 @@ int compat_43_sys_gethostname __P((struct proc *, void *, register_t *)); int compat_43_sys_sethostname __P((struct proc *, void *, register_t *)); int compat_43_sys_getdtablesize __P((struct proc *, void *, register_t *)); int sys_dup2 __P((struct proc *, void *, register_t *)); -int sys_fcntl __P((struct proc *, void *, register_t *)); +int sunos_sys_fcntl __P((struct proc *, void *, register_t *)); int sys_select __P((struct proc *, void *, register_t *)); int sys_fsync __P((struct proc *, void *, register_t *)); int sys_setpriority __P((struct proc *, void *, register_t *)); diff --git a/sys/compat/sunos/sunos_sysent.c b/sys/compat/sunos/sunos_sysent.c index dbd17ba4f5e..19e140a7983 100644 --- a/sys/compat/sunos/sunos_sysent.c +++ b/sys/compat/sunos/sunos_sysent.c @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.32 1995/10/07 06:27:35 mycroft Exp + * created from OpenBSD */ #include @@ -218,8 +218,8 @@ struct sysent sunos_sysent[] = { sys_dup2 }, /* 90 = dup2 */ { 0, 0, sys_nosys }, /* 91 = unimplemented getdopt */ - { 3, s(struct sys_fcntl_args), - sys_fcntl }, /* 92 = fcntl */ + { 3, s(struct sunos_sys_fcntl_args), + sunos_sys_fcntl }, /* 92 = fcntl */ { 5, s(struct sys_select_args), sys_select }, /* 93 = select */ { 0, 0, diff --git a/sys/compat/sunos/syscalls.master b/sys/compat/sunos/syscalls.master index 6a6f00f3dbd..df55f67aea8 100644 --- a/sys/compat/sunos/syscalls.master +++ b/sys/compat/sunos/syscalls.master @@ -1,4 +1,5 @@ - $NetBSD: syscalls.master,v 1.32 1995/10/07 06:27:35 mycroft Exp $ + $OpenBSD: syscalls.master,v 1.2 1996/04/18 21:21:48 niklas Exp $ +; $NetBSD: syscalls.master,v 1.33 1996/02/28 16:05:43 pk Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -146,7 +147,7 @@ 89 NOARGS { int compat_43_sys_getdtablesize(void); } 90 NOARGS { int sys_dup2(u_int from, u_int to); } 91 UNIMPL getdopt -92 NOARGS { int sys_fcntl(int fd, int cmd, void *arg); } +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 diff --git a/sys/compat/svr4/svr4_conf.h b/sys/compat/svr4/svr4_conf.h new file mode 100644 index 00000000000..bccc4e3b75c --- /dev/null +++ b/sys/compat/svr4/svr4_conf.h @@ -0,0 +1,41 @@ +/* $OpenBSD: svr4_conf.h,v 1.1 1996/04/18 21:21:26 niklas Exp $ */ +/* $NetBSD: svr4_conf.h,v 1.1 1996/03/14 19:29:11 christos Exp $ */ + +/* + * Copyright (c) 1995 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christos Zoulas. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#ifdef COMPAT_SVR4 +# define NSVR4_NET 1 +#else +# define NSVR4_NET 0 +#endif + +cdev_decl(svr4_net); diff --git a/sys/compat/svr4/svr4_net.c b/sys/compat/svr4/svr4_net.c index 778bd936c8b..91a7ace6f93 100644 --- a/sys/compat/svr4/svr4_net.c +++ b/sys/compat/svr4/svr4_net.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_net.c,v 1.4 1996/04/17 05:24:19 mickey Exp $ */ +/* $OpenBSD: svr4_net.c,v 1.5 1996/04/18 21:21:28 niklas Exp $ */ /* $NetBSD: svr4_net.c,v 1.8 1996/03/30 22:41:02 christos Exp $ */ /* @@ -58,6 +58,7 @@ #include #include #include +#include /* * Device minor numbers diff --git a/sys/compat/svr4/svr4_termios.c b/sys/compat/svr4/svr4_termios.c index e00a0d80ddc..210fefb3bdc 100644 --- a/sys/compat/svr4/svr4_termios.c +++ b/sys/compat/svr4/svr4_termios.c @@ -1,3 +1,4 @@ +/* $OpenBSD: svr4_termios.c,v 1.4 1996/04/18 21:21:30 niklas Exp $ */ /* $NetBSD: svr4_termios.c,v 1.8 1996/03/30 22:38:23 christos Exp $ */ /* diff --git a/sys/compat/ultrix/ultrix_fs.c b/sys/compat/ultrix/ultrix_fs.c index 9829c895d32..7dd43d413c6 100644 --- a/sys/compat/ultrix/ultrix_fs.c +++ b/sys/compat/ultrix/ultrix_fs.c @@ -1,4 +1,5 @@ -/* $NetBSD: ultrix_fs.c,v 1.2 1995/12/26 10:06:14 jonathan Exp $ */ +/* $OpenBSD: ultrix_fs.c,v 1.2 1996/04/18 21:21:49 niklas Exp $ */ +/* $NetBSD: ultrix_fs.c,v 1.3 1996/02/19 15:41:39 pk Exp $ */ /* * Copyright (c) 1995 @@ -37,6 +38,9 @@ #include #include +#include +#include +#include #include #include @@ -292,7 +296,7 @@ struct osockaddr_in { */ struct ultrix_nfs_args { struct osockaddr_in *addr; /* file server address */ - nfsv2fh_t *fh; /* file handle to be mounted */ + void *fh; /* file handle to be mounted */ int flags; /* flags */ int wsize; /* write size in bytes */ int rsize; /* read size in bytes */ @@ -415,12 +419,14 @@ ultrix_sys_mount(p, v, retval) SCARG(&nuap, data) = usp; usp += sizeof (na); /* allocate space above caller's stack for server sockaddr */ + na.version = NFS_ARGSVERSION; na.addr = (struct sockaddr *)usp; usp += sizeof(*sap); na.addrlen = sap->sin_len; na.sotype = SOCK_DGRAM; na.proto = IPPROTO_UDP; na.fh = una.fh; + na.fhsize = NFSX_V2FH; na.flags = /*una.flags;*/ NFSMNT_NOCONN | NFSMNT_RESVPORT; na.wsize = una.wsize; na.rsize = una.rsize; diff --git a/sys/compat/ultrix/ultrix_misc.c b/sys/compat/ultrix/ultrix_misc.c index 1f5b5341658..212453ec3ab 100644 --- a/sys/compat/ultrix/ultrix_misc.c +++ b/sys/compat/ultrix/ultrix_misc.c @@ -1,4 +1,5 @@ -/* $NetBSD: ultrix_misc.c,v 1.20 1996/01/07 13:38:51 jonathan Exp $ */ +/* $OpenBSD: ultrix_misc.c,v 1.6 1996/04/18 21:21:50 niklas Exp $ */ +/* $NetBSD: ultrix_misc.c,v 1.21 1996/02/19 15:41:38 pk Exp $ */ /* * Copyright (c) 1992, 1993 @@ -90,7 +91,7 @@ #include #include -#include +#include #include #include -- 2.20.1