Subject: Re: readdir()/getdents() portability -- "."/".." always first?
To: Jaromir Dolecek <jdolecek@NetBSD.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: current-users
Date: 09/05/2003 12:38:00
jdolecek@NetBSD.org said:
> Currently, all our filesystems do return '.' and '..' as first two
> entries for getdent().

Our {,p,b}make is used to cross-compile NetBSD on other platforms
too. Can we be sure eg for these new fancy Linux filesystems?

I've just deleted the two offending lines in make/dir.c, and
haven't seen any bad effects so far.
(This makes that the "." and ".." are stored in the hash table for
each directory, which is probably better than a strcmp() for
each directory entry.)

> Perhaps it would be good if coda_readdir()
> would make sure to do the same.

Hmm - sorting the entries or whatever string comparisions would be
quite a burden.

best regards
Matthias