delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/01/23:07:50

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
Date: Tue, 1 Feb 2005 23:08:24 -0500
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: several more bugs found by coreutils
Message-ID: <20050202040824.GA11824@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
References: <020120052058 DOT 2301 DOT 41FFED5A000D5EEC000008FD22007614380A050E040D0C079D0A AT comcast DOT net> <20050201215100 DOT GA8400 AT trixie DOT casa DOT cgf DOT cx> <42004DEE DOT 6000602 AT byu DOT net>
Mime-Version: 1.0
In-Reply-To: <42004DEE.6000602@byu.net>
User-Agent: Mutt/1.4.1i

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/

- Raw text -


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