From f96a681fe0a5dac0803338255794b824d3d5d420 Mon Sep 17 00:00:00 2001 From: niklas Date: Thu, 23 Jan 1997 16:12:15 +0000 Subject: [PATCH] Sync with NetBSD 970118 --- sys/compat/ibcs2/files.ibcs2 | 4 +- sys/compat/ibcs2/ibcs2_errno.c | 3 +- sys/compat/ibcs2/ibcs2_exec.c | 5 ++- sys/compat/ibcs2/ibcs2_ioctl.c | 4 +- sys/compat/ibcs2/ibcs2_ipc.c | 4 +- sys/compat/ibcs2/ibcs2_misc.c | 75 ++++++++++++++++---------------- sys/compat/ibcs2/ibcs2_socksys.c | 6 +-- sys/compat/ibcs2/ibcs2_stat.c | 3 +- sys/compat/ibcs2/ibcs2_util.h | 4 +- sys/compat/ibcs2/syscalls.master | 8 ++-- 10 files changed, 58 insertions(+), 58 deletions(-) diff --git a/sys/compat/ibcs2/files.ibcs2 b/sys/compat/ibcs2/files.ibcs2 index ce331755ed2..eca984870e5 100644 --- a/sys/compat/ibcs2/files.ibcs2 +++ b/sys/compat/ibcs2/files.ibcs2 @@ -1,7 +1,7 @@ -# $OpenBSD: files.ibcs2,v 1.4 1997/01/19 00:43:40 niklas Exp $ +# $OpenBSD: files.ibcs2,v 1.5 1997/01/23 16:12:15 niklas Exp $ # $NetBSD: files.ibcs2,v 1.3 1995/08/14 01:34:09 mycroft Exp $ # -# Config.new file description for machine-independent IBCS-2 compat code. +# Config file description for machine-independent IBCS-2 compat code. # Included by ports that need it. # ports should define any machine-specific files they need in their diff --git a/sys/compat/ibcs2/ibcs2_errno.c b/sys/compat/ibcs2/ibcs2_errno.c index b4bfea0922a..4e2bcf68ad7 100644 --- a/sys/compat/ibcs2/ibcs2_errno.c +++ b/sys/compat/ibcs2/ibcs2_errno.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ibcs2_errno.c,v 1.3 1996/08/02 20:35:03 niklas Exp $ */ +/* $OpenBSD: ibcs2_errno.c,v 1.4 1997/01/23 16:12:16 niklas Exp $ */ /* $NetBSD: ibcs2_errno.c,v 1.2 1996/05/03 17:05:16 christos Exp $ */ /* @@ -118,4 +118,3 @@ int bsd2ibcs_errno[] = { 0, /* 80 */ 0, /* 81 */ }; - diff --git a/sys/compat/ibcs2/ibcs2_exec.c b/sys/compat/ibcs2/ibcs2_exec.c index f91d08f4460..6f660dd40dd 100644 --- a/sys/compat/ibcs2/ibcs2_exec.c +++ b/sys/compat/ibcs2/ibcs2_exec.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ibcs2_exec.c,v 1.4 1996/08/31 09:24:02 pefo Exp $ */ -/* $NetBSD: ibcs2_exec.c,v 1.11 1996/05/03 17:05:19 christos Exp $ */ +/* $OpenBSD: ibcs2_exec.c,v 1.5 1997/01/23 16:12:16 niklas Exp $ */ +/* $NetBSD: ibcs2_exec.c,v 1.12 1996/10/12 02:13:52 thorpej Exp $ */ /* * Copyright (c) 1994, 1995 Scott Bartram @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/compat/ibcs2/ibcs2_ioctl.c b/sys/compat/ibcs2/ibcs2_ioctl.c index a0158c8647d..4b9bea3dad0 100644 --- a/sys/compat/ibcs2/ibcs2_ioctl.c +++ b/sys/compat/ibcs2/ibcs2_ioctl.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ibcs2_ioctl.c,v 1.5 1996/08/10 12:09:21 deraadt Exp $ */ -/* $NetBSD: ibcs2_ioctl.c,v 1.11 1996/05/03 17:05:22 christos Exp $ */ +/* $OpenBSD: ibcs2_ioctl.c,v 1.6 1997/01/23 16:12:17 niklas Exp $ */ +/* $NetBSD: ibcs2_ioctl.c,v 1.12 1996/08/10 09:08:26 mycroft Exp $ */ /* * Copyright (c) 1994, 1995 Scott Bartram diff --git a/sys/compat/ibcs2/ibcs2_ipc.c b/sys/compat/ibcs2/ibcs2_ipc.c index bacbe15e34a..43fe6ca1359 100644 --- a/sys/compat/ibcs2/ibcs2_ipc.c +++ b/sys/compat/ibcs2/ibcs2_ipc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ibcs2_ipc.c,v 1.4 1996/10/17 19:15:47 niklas Exp $ */ -/* $NetBSD: ibcs2_ipc.c,v 1.6 1996/05/03 17:05:23 christos Exp $ */ +/* $OpenBSD: ibcs2_ipc.c,v 1.5 1997/01/23 16:12:17 niklas Exp $ */ +/* $NetBSD: ibcs2_ipc.c,v 1.7 1997/01/18 01:51:41 mycroft Exp $ */ /* * Copyright (c) 1995 Scott Bartram diff --git a/sys/compat/ibcs2/ibcs2_misc.c b/sys/compat/ibcs2/ibcs2_misc.c index 95cefda3d71..d24bd0df34a 100644 --- a/sys/compat/ibcs2/ibcs2_misc.c +++ b/sys/compat/ibcs2/ibcs2_misc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ibcs2_misc.c,v 1.7 1996/08/10 12:09:22 deraadt Exp $ */ -/* $NetBSD: ibcs2_misc.c,v 1.15 1996/05/03 17:05:25 christos Exp $ */ +/* $OpenBSD: ibcs2_misc.c,v 1.8 1997/01/23 16:12:18 niklas Exp $ */ +/* $NetBSD: ibcs2_misc.c,v 1.23 1997/01/15 01:37:49 perry Exp $ */ /* * Copyright (c) 1994, 1995 Scott Bartram @@ -418,7 +418,8 @@ again: idb.d_off = (ibcs2_off_t)off; idb.d_reclen = (u_short)ibcs2_reclen; strcpy(idb.d_name, bdp->d_name); - if ((error = copyout((caddr_t)&idb, outp, ibcs2_reclen))) + error = copyout((caddr_t)&idb, outp, ibcs2_reclen); + if (error) goto out; /* advance past this real entry */ inp += reclen; @@ -453,11 +454,11 @@ ibcs2_sys_read(p, v, retval) syscallarg(u_int) nbytes; } */ *uap = v; register struct dirent *bdp; - register struct vnode *vp; - register caddr_t inp, buf; /* BSD-format */ - register int len, reclen; /* BSD-format */ - register caddr_t outp; /* iBCS2-format */ - register int resid; /* iBCS2-format */ + struct vnode *vp; + caddr_t inp, buf; /* BSD-format */ + int len, reclen; /* BSD-format */ + caddr_t outp; /* iBCS2-format */ + int resid, ibcs2_reclen;/* iBCS2-format */ struct file *fp; struct uio auio; struct iovec aiov; @@ -504,12 +505,9 @@ again: */ error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, cookiebuf, ncookies); - if (error) { - DPRINTF(("VOP_READDIR failed: %d\n", error)); + if (error) goto out; - } - inp = buf + off; - buflen -= off; + inp = buf; outp = SCARG(uap, buf); resid = SCARG(uap, nbytes); if ((len = buflen - auio.uio_resid) == 0) @@ -519,12 +517,13 @@ again: reclen = bdp->d_reclen; if (reclen & 3) panic("ibcs2_read"); + off = *cookie++; /* each entry points to the next */ if (bdp->d_fileno == 0) { inp += reclen; /* it is a hole; squish it out */ - off = *cookie++; continue; } - if (reclen > len || resid < sizeof(struct ibcs2_direct)) { + ibcs2_reclen = 16; + if (reclen > len || resid < ibcs2_reclen) { /* entry too big for buffer, so just stop */ outp++; break; @@ -540,15 +539,14 @@ again: idb.ino = (bdp->d_fileno > 0xfffe) ? 0xfffe : bdp->d_fileno; (void)copystr(bdp->d_name, idb.name, 14, &size); bzero(idb.name + size, 14 - size); - error = copyout(&idb, outp, sizeof(struct ibcs2_direct)); + error = copyout(&idb, outp, ibcs2_reclen); if (error) goto out; /* advance past this real entry */ - off = *cookie++; /* each entry points to the next */ inp += reclen; /* advance output past iBCS2-shaped entry */ - outp += sizeof(struct ibcs2_direct); - resid -= sizeof(struct ibcs2_direct); + outp += ibcs2_reclen; + resid -= ibcs2_reclen; } /* if we squished out the whole block, try again */ if (outp == SCARG(uap, buf)) @@ -641,8 +639,7 @@ ibcs2_sys_setgroups(p, v, retval) caddr_t sg = stackgap_init(p->p_emul); SCARG(&sa, gidsetsize) = SCARG(uap, gidsetsize); - SCARG(&sa, gidset) = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) * - sizeof(gid_t *)); + gp = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) * sizeof(gid_t *)); iset = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) * sizeof(ibcs2_gid_t *)); if (SCARG(&sa, gidsetsize)) { @@ -651,8 +648,9 @@ ibcs2_sys_setgroups(p, v, retval) if (error) return error; } - for (i = 0, gp = SCARG(&sa, gidset); i < SCARG(&sa, gidsetsize); i++) - *gp++ = (gid_t)iset[i]; + for (i = 0; i < SCARG(&sa, gidsetsize); i++) + gp[i]= (gid_t)iset[i]; + SCARG(&sa, gidset) = gp; return sys_setgroups(p, &sa, retval); } @@ -704,7 +702,8 @@ xenix_sys_ftime(p, v, retval) itb.millitm = (tv.tv_usec / 1000); itb.timezone = tz.tz_minuteswest; itb.dstflag = tz.tz_dsttime; - return copyout((caddr_t)&itb, (caddr_t)SCARG(uap, tp), xenix_timeb_len); + return copyout((caddr_t)&itb, (caddr_t)SCARG(uap, tp), + xenix_timeb_len); } int @@ -962,14 +961,16 @@ ibcs2_sys_stime(p, v, retval) int error; struct sys_settimeofday_args sa; caddr_t sg = stackgap_init(p->p_emul); + struct timeval *tvp; - SCARG(&sa, tv) = stackgap_alloc(&sg, sizeof(*SCARG(&sa, tv))); + tvp = stackgap_alloc(&sg, sizeof(*SCARG(&sa, tv))); SCARG(&sa, tzp) = NULL; - error = copyin((caddr_t)SCARG(uap, timep), - &(SCARG(&sa, tv)->tv_sec), sizeof(long)); + error = copyin((caddr_t)SCARG(uap, timep), (void *)&tvp->tv_sec, + sizeof(long)); if (error) return error; - SCARG(&sa, tv)->tv_usec = 0; + tvp->tv_usec = 0; + SCARG(&sa, tv) = tvp; if ((error = sys_settimeofday(p, &sa, retval)) != 0) return EPERM; return 0; @@ -999,14 +1000,12 @@ ibcs2_sys_utime(p, v, retval) sizeof(ubuf)); if (error) return error; - SCARG(&sa, tptr) = stackgap_alloc(&sg, - 2 * sizeof(struct timeval *)); - tp = (struct timeval *)SCARG(&sa, tptr); - tp->tv_sec = ubuf.actime; - tp->tv_usec = 0; - tp++; - tp->tv_sec = ubuf.modtime; - tp->tv_usec = 0; + tp = stackgap_alloc(&sg, 2 * sizeof(struct timeval *)); + tp[0].tv_sec = ubuf.actime; + tp[0].tv_usec = 0; + tp[1].tv_sec = ubuf.modtime; + tp[1].tv_usec = 0; + SCARG(&sa, tptr) = tp; } else SCARG(&sa, tptr) = NULL; return sys_utimes(p, &sa, retval); @@ -1026,10 +1025,10 @@ ibcs2_sys_nice(p, v, retval) SCARG(&sa, which) = PRIO_PROCESS; SCARG(&sa, who) = 0; - SCARG(&sa, prio) = p->p_nice + SCARG(uap, incr); + SCARG(&sa, prio) = p->p_nice - PZERO + SCARG(uap, incr); if ((error = sys_setpriority(p, &sa, retval)) != 0) return EPERM; - *retval = p->p_nice; + *retval = p->p_nice - PZERO; return 0; } diff --git a/sys/compat/ibcs2/ibcs2_socksys.c b/sys/compat/ibcs2/ibcs2_socksys.c index 3cee3ff2929..0b4668124ad 100644 --- a/sys/compat/ibcs2/ibcs2_socksys.c +++ b/sys/compat/ibcs2/ibcs2_socksys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ibcs2_socksys.c,v 1.3 1996/08/02 20:35:10 niklas Exp $ */ +/* $OpenBSD: ibcs2_socksys.c,v 1.4 1997/01/23 16:12:19 niklas Exp $ */ /* $NetBSD: ibcs2_socksys.c,v 1.4 1996/05/03 17:05:29 christos Exp $ */ /* @@ -131,8 +131,8 @@ ibcs2_socksys(p, v, retval) default: printf("socksys unknown %08x %08x %08x %08x %08x %08x %08x\n", - realargs[0], realargs[1], realargs[2], realargs[3], - realargs[4], realargs[5], realargs[6]); + realargs[0], realargs[1], realargs[2], realargs[3], + realargs[4], realargs[5], realargs[6]); return EINVAL; } /* NOTREACHED */ diff --git a/sys/compat/ibcs2/ibcs2_stat.c b/sys/compat/ibcs2/ibcs2_stat.c index d8fc2c0694c..4614b6a1f44 100644 --- a/sys/compat/ibcs2/ibcs2_stat.c +++ b/sys/compat/ibcs2/ibcs2_stat.c @@ -1,5 +1,6 @@ -/* $OpenBSD: ibcs2_stat.c,v 1.3 1996/08/02 20:35:11 niklas Exp $ */ +/* $OpenBSD: ibcs2_stat.c,v 1.4 1997/01/23 16:12:19 niklas Exp $ */ /* $NetBSD: ibcs2_stat.c,v 1.5 1996/05/03 17:05:32 christos Exp $ */ + /* * Copyright (c) 1995 Scott Bartram * All rights reserved. diff --git a/sys/compat/ibcs2/ibcs2_util.h b/sys/compat/ibcs2/ibcs2_util.h index d0e91e370d1..7ac809a43b8 100644 --- a/sys/compat/ibcs2/ibcs2_util.h +++ b/sys/compat/ibcs2/ibcs2_util.h @@ -1,5 +1,5 @@ -/* $OpenBSD: ibcs2_util.h,v 1.2 1996/08/02 20:35:18 niklas Exp $ */ -/* $NetBSD: ibcs2_util.h,v 1.2 1995/06/24 20:19:06 christos Exp $ */ +/* $OpenBSD: ibcs2_util.h,v 1.3 1997/01/23 16:12:20 niklas Exp $ */ +/* $NetBSD: ibcs2_util.h,v 1.4 1996/10/13 00:46:52 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas diff --git a/sys/compat/ibcs2/syscalls.master b/sys/compat/ibcs2/syscalls.master index 3908119edbd..a56e1b66b86 100644 --- a/sys/compat/ibcs2/syscalls.master +++ b/sys/compat/ibcs2/syscalls.master @@ -1,5 +1,5 @@ - $OpenBSD: syscalls.master,v 1.5 1996/08/02 21:55:17 niklas Exp $ -; $NetBSD: syscalls.master,v 1.8 1996/01/07 06:09:43 mycroft Exp $ + $OpenBSD: syscalls.master,v 1.6 1997/01/23 16:12:20 niklas Exp $ +; $NetBSD: syscalls.master,v 1.10 1996/09/07 14:21:59 mycroft Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -160,8 +160,8 @@ 86 STD { int ibcs2_sys_putmsg(int fd, \ struct ibcs2_stropts *ctl, \ struct ibcs2_stropts *dat, int flags); } -87 NOARGS { int sys_poll(struct pollfd *fds, \ - unsigned long nfds, int timeout); } +87 NOARGS { int sys_poll(struct pollfd *fds, u_long nfds, \ + int timeout); } 88 UNIMPL 89 UNIMPL 90 STD { int ibcs2_sys_symlink(char *path, char *link); } -- 2.20.1