delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/01/22:53:32

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <42004DEE.6000602@byu.net>
Date: Tue, 01 Feb 2005 20:50:06 -0700
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: several more bugs found by coreutils
References: <020120052058 DOT 2301 DOT 41FFED5A000D5EEC000008FD22007614380A050E040D0C079D0A AT comcast DOT net> <20050201215100 DOT GA8400 AT trixie DOT casa DOT cgf DOT cx>
In-Reply-To: <20050201215100.GA8400@trixie.casa.cgf.cx>
X-IsSubscribed: yes

-----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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019