Mail Archives: cygwin/2005/02/01/22:53:32
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Christopher Faylor on 2/1/2005 2:51 PM:
> On Tue, Feb 01, 2005 at 08:58:03PM +0000, Eric Blake wrote:
>
>>readdir() populates the dirent.d_ino member with a hashed filename,
>
> This is not going to be fixed. It's a longstanding problem. There is
> no eay way to fix it which would not engender a slowdown in readdir
> for a little-used feature.
If it really is little-used and expensive to implement, why not just get
rid of the d_ino member? POSIX allows this, as d_ino is only required
under full XSI support:
http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html
Portable programs are already programmed (coreutils uses an autoconf
check) to notice whether d_ino exists, and if not, fall back to stat()ing
directory members if they really need the inode. When I recompiled the
coreutils pwd(1) program to overlook the existance of d_ino, it started
working correctly again.
For backwards compatibility with existing code, you will still need an
ino_t in the place of d_ino. What about something like the following
idea? Perhaps it would be useful to rename it d_hash, and add a
corresponding st_hash member to struct stat. Then st_hash is always the
hash of the filename, whether it is also st_ino (on Win9x) or not (on
Win2k). And programs that know the cygwin internals could then bypass
calling stat() by comparing the d_hash members, similar to what is
currently being attempted (but failing) by comparing the d_ino members.
- --
Life is short - so eat dessert first!
Eric Blake ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCAE3u84KuGfSFAYARArveAJ9oTeEFY+Pj9I/6HgLdPaSPVvMgIQCgwzBs
ysnKv/wJje1cH22N0VrFdkE=
=AI83
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -