Subject: Re: SVR4 compat: can't get current directory?
To: Todd Vierling <tv@pobox.com>
From: Frank van der Linden <frank@wins.uva.nl>
List: current-users
Date: 10/26/1997 12:17:17
On Sat, Oct 25, 1997 at 07:59:59PM -0400, Todd Vierling wrote:
> On Sat, 25 Oct 1997, Frank van der Linden wrote:
> /*      $NetBSD: svr4_misc.c,v 1.51 1997/10/19 00:16:08 fvdl Exp $       */
> 
> I'm using only ffs (/), mfs (/tmp), and union (/usr/src).  The bug happens
> on all filesystems.  No NFS anywhere, and NFS isn't even compiled into my
> kernel.  It also doesn't have much to do with "large directories" or listing
> them the "first time"--this is always reproducable on any directory but /.

Ok, I see the problem. When correcting a mistake I made in the getdents()
emulation, I forgot to back one part out (I did do getdents64, but not
the normal one). The following diff should make things work for you.
Btw: watch out with emulations and union mounts; emulation dir
reads do not grok union mounts currently (they never have).

Index: svr4_misc.c
===================================================================
RCS file: /a/cvsroot/src/sys/compat/svr4/svr4_misc.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -c -r1.51 -r1.52
*** svr4_misc.c	1997/10/19 00:16:08	1.51
--- svr4_misc.c	1997/10/26 11:13:46	1.52
***************
*** 1,4 ****
! /*	$NetBSD: svr4_misc.c,v 1.51 1997/10/19 00:16:08 fvdl Exp $	 */
  
  /*
   * Copyright (c) 1994 Christos Zoulas
--- 1,4 ----
! /*	$NetBSD: svr4_misc.c,v 1.52 1997/10/26 11:13:46 fvdl Exp $	 */
  
  /*
   * Copyright (c) 1994 Christos Zoulas
***************
*** 383,389 ****
  	inp = buf;
  	outp = SCARG(uap, buf);
  	resid = SCARG(uap, nbytes);
! 	if (eofflag || (len = buflen - auio.uio_resid) == 0)
  		goto eof;
  
  	for (cookie = cookiebuf; len > 0; len -= reclen) {
--- 383,389 ----
  	inp = buf;
  	outp = SCARG(uap, buf);
  	resid = SCARG(uap, nbytes);
! 	if ((len = buflen - auio.uio_resid) == 0)
  		goto eof;
  
  	for (cookie = cookiebuf; len > 0; len -= reclen) {