On Tue, Feb 01, 2005 at 08:50:06PM -0700, Eric Blake wrote: >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.
http://cygwin.com/acronyms/#PTC cgf -- 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/