-/* $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
free(buf, M_TEMP);
}
-done:
vrele(nd.ni_vp);
if (!cflag)
vrele(ndroot.ni_vp);
-/* $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
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;
-/* $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
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;
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);
-/* $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
#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;
return (flags);
}
+void
ttcompatsetflags(tp, t)
register struct tty *tp;
register struct termios *t;
t->c_cflag = cflag;
}
+void
ttcompatsetlflags(tp, t)
register struct tty *tp;
register struct termios *t;
-/* $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
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)
} 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,
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)
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;
-/* $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
#include <sys/mount.h>
#include <sys/syscallargs.h>
+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;
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);
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
* Return status information about a file descriptor.
*/
/* ARGSUSED */
+int
compat_43_sys_fstat(p, v, retval)
struct proc *p;
void *v;
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);
#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) &&
+/* $OpenBSD: linux_audio.c,v 1.2 1996/04/18 21:21:38 niklas Exp $ */
+
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/systm.h>
+/* $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 */
-/* $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 $ */
/*
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..
-/* $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)
-/* $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.
{
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;
-/* $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 */
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 {
-/* $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
#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
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;
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);
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);
-/* $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.
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
struct sunos_termios *st;
{
register u_long l, r;
+ int s;
l = bt->c_iflag;
r = ((l & IGNBRK) ? 0x00000001 : 0);
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;
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 ||
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);
}
*/
#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)); \
}
* 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));
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;
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;
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;
}
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);
+}
-/* $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
#include <sys/systm.h>
#include <sys/namei.h>
#include <sys/proc.h>
-#include <sys/dir.h>
+#include <sys/dirent.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/filedesc.h>
#include <sys/utsname.h>
#include <sys/unistd.h>
#include <sys/syscallargs.h>
+#include <sys/conf.h>
+#include <sys/socketvar.h>
+#include <sys/cpu.h>
#include <compat/sunos/sunos.h>
#include <compat/sunos/sunos_syscallargs.h>
#include <miscfs/specfs/specdev.h>
#include <nfs/rpcv2.h>
-#include <nfs/nfsv2.h>
+#include <nfs/nfsproto.h>
#include <nfs/nfs.h>
#include <vm/vm.h>
+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;
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;
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));
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) {
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);
}
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;
* 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;
}
void *v;
register_t *retval;
{
- struct sunos_sys_quotactl_args *uap = v;
return EINVAL;
}
void *v;
register_t *retval;
{
- struct sunos_vhangup_args *uap = v;
struct session *sp = p->p_session;
if (sp->s_ttyvp == 0)
return 0;
}
-static
+static int
sunstatfs(sp, buf)
struct statfs *sp;
caddr_t buf;
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));
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));
void *v;
register_t *retval;
{
- struct sunos_sys_exportfs_args *uap = v;
-
/*
* XXX: should perhaps translate into a mount(2)
* with MOUNT_EXPORT?
};
static int nreqs = sizeof(sreq2breq) / sizeof(sreq2breq[0]);
+int
sunos_sys_ptrace(p, v, retval)
struct proc *p;
void *v;
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++)
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:
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);
/*
}
#endif /* sun3 */
- return (boot(bsd_howto));
+ boot(bsd_howto);
+ return 0;
}
/*
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
* 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; }
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;
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 *));
* 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 <sys/param.h>
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,
- $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
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
--- /dev/null
+/* $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 <sys/conf.h>
+
+#ifdef COMPAT_SVR4
+# define NSVR4_NET 1
+#else
+# define NSVR4_NET 0
+#endif
+
+cdev_decl(svr4_net);
-/* $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 $ */
/*
#include <compat/svr4/svr4_syscallargs.h>
#include <compat/svr4/svr4_ioctl.h>
#include <compat/svr4/svr4_stropts.h>
+#include <compat/svr4/svr4_conf.h>
/*
* Device minor numbers
+/* $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 $ */
/*
-/* $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
#include <net/if.h>
#include <netinet/in.h>
+#include <nfs/rpcv2.h>
+#include <nfs/nfsproto.h>
+#include <nfs/nfs.h>
#include <sys/syscallargs.h>
#include <compat/ultrix/ultrix_syscallargs.h>
*/
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 */
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;
-/* $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
#include <miscfs/specfs/specdev.h>
#include <nfs/rpcv2.h>
-#include <nfs/nfsv2.h>
+#include <nfs/nfsproto.h>
#include <nfs/nfs.h>
#include <vm/vm.h>