summaryrefslogtreecommitdiff
path: root/sys/compat/svr4
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-02-10 00:16:13 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-02-10 00:16:13 +0000
commit3e01cdc2fb4d15a5bd8a0675450ba943bc9a0059 (patch)
treef8ae8011cd8a05047f8e60574cf4e7fe7d5050c6 /sys/compat/svr4
parent89bb5cf80c913788c0ea306ae547b6e180496f15 (diff)
Correct directory entry reads, big directories lost entries as it were.
Also, fix the NCR SVR4 rdebug syscall emulation.
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/svr4_misc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index 0cb46da13df..1a509b1da03 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svr4_misc.c,v 1.20 1998/03/06 21:58:09 niklas Exp $ */
+/* $OpenBSD: svr4_misc.c,v 1.21 1999/02/10 00:16:12 niklas Exp $ */
/* $NetBSD: svr4_misc.c,v 1.42 1996/12/06 03:22:34 christos Exp $ */
/*
@@ -267,7 +267,7 @@ again:
if (error)
goto out;
- if (!error && !cookiebuf) {
+ if (!error && !cookiebuf && !eofflag) {
error = EPERM;
goto out;
}
@@ -282,10 +282,10 @@ again:
bdp = (struct dirent *)inp;
reclen = bdp->d_reclen;
if (reclen & 3)
- panic("svr4_getdents");
- off = *cookie++; /* each entry points to the next */
+ panic("svr4_getdents: bad reclen");
if (bdp->d_fileno == 0) {
inp += reclen; /* it is a hole; squish it out */
+ off = *cookie++;
continue;
}
svr4_reclen = SVR4_RECLEN(&idb, bdp->d_namlen);
@@ -294,6 +294,8 @@ again:
outp++;
break;
}
+ off = *cookie++; /* each entry points to the next */
+
/*
* Massage in place to make a SVR4-shaped dirent (otherwise
* we have to worry about touching user memory outside of
@@ -305,8 +307,10 @@ again:
strcpy(idb.d_name, bdp->d_name);
if ((error = copyout((caddr_t)&idb, outp, svr4_reclen)))
goto out;
+
/* advance past this real entry */
inp += reclen;
+
/* advance output past SVR4-shaped entry */
outp += svr4_reclen;
resid -= svr4_reclen;
@@ -1385,7 +1389,7 @@ svr4_sys_rdebug(p, v, retval)
void *v;
register_t *retval;
{
-#ifdef SVR4_COMPAT_NCR
+#ifdef COMPAT_SVR4_NCR
return (ENXIO);
#else
return (p->p_os == OOS_NCR ? ENXIO : sys_nosys(p, v, retval));