Subject: Re: lib/24324: telldir issues
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 05/13/2006 17:45:02
The following reply was made to PR lib/24324; it has been noted by GNATS.

From: David Laight <david@l8s.co.uk>
To: Andreas Wrede <andreas@planix.com>
Cc: gnats-bugs@netbsd.org,
	NetBSD-current Discussion List <current-users@netbsd.org>
Subject: Re: lib/24324: telldir issues
Date: Sat, 13 May 2006 18:50:49 +0100

 On Sat, May 13, 2006 at 07:40:41AM -0400, Andreas Wrede wrote:
 > Is there a better way to solve the problem?
 
 Using the value 0 to mean 'start of directory' would save a lot
 of faffing about in the normal code paths...
 
 The 'long dd_rewind' entry in struct _dirdesc could then be replaced
 with the 'struct _dirpos **dd_plist' without breaking binary compatibility
 (since 'long' and 'void *' has the same size and alignment on all NetBSD
 ports).
 
 Thinking further, replacing the 'long dd_rewind' with a pointer to
 library private data would be even better.  This would let the
 library to hide the gory details from applications.
 Since this woule be allocated by opendir(), telldir() could keep
 it's 'const DIR *' prototype.
 
 For complete binary compatibility, the value in the (old) dd_rewind
 field could be accepted as a token for 'start of directory'.
 
 	David
 
 -- 
 David Laight: david@l8s.co.uk