Subject: Re: lib/24324: telldir issues
To: Andreas Wrede <firstname.lastname@example.org>
From: David Laight <email@example.com>
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
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 Laight: firstname.lastname@example.org