Subject: Re: lib/24324: telldir issues
To: Andreas Wrede <andreas@planix.com>
From: David Laight <david@l8s.co.uk>
List: current-users
Date: 05/13/2006 18:50:49
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