[haiku-development] Re: Ticket #2617 seekdir and telldir not implemented

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 19 Aug 2008 18:13:58 +0200 CEST

"Rene Gollent" <anevilyak@xxxxxxxxx> wrote:
> On Tue, Aug 19, 2008 at 2:48 AM, Salvatore Benedetto <
> emitrax@xxxxxxxxx> wrote:
> > In doubts, you can always "get inspired" ;-) by others 
> > implementation,
> > like openbsd or opensolaris
> The problem is that's not all that helpful since the implementation 
> of
> seekdir/telldir by definition depends partly on how your filesystems
> handle directory ordering, which is why the opengroup specs are quite
> vague on expected behavior. In this case it's a bit non-trivial since
> readdir() grabs a chunk from the kernel and then caches that in the
> __DIR struct until it runs out of entries to loop through, and as 
> such
> seekdir/telldir would have to be able to determine not only the index
> of the current chunk, but also which chunk. At the moment I don't
> easily see how to get enough information to do that.

If needed we could extent the DIR structure to have all the info 
necessary.

Bye,
   Axel.


Other related posts: