[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dirent.d_ino check

From: Paul Eggert
Subject: Re: dirent.d_ino check
Date: Mon, 09 May 2005 21:55:04 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

address@hidden (Eric Blake) writes:

> It looks like everywhere that coreutils looks for d_ino, it uses
> macros that default to 0 on systems without support, so that d_ino
> of 0 falls back to the stat() family.

No, actually, it skips such entries.

However, historically (pre-POSIX?) many implementations used d_ino ==
0 to mark entries that were not actually present, and a lot of code
skips them to this day (including coreutils).  So in practice, file
systems should not hand out file serial numbers equal to zero.

POSIX allows implementations where some inode numbers are zero, but I
don't know of any such systems.

> having cygwin return 0 rather than a bogus hash when the cost of
> determining the inode is prohibitive

Given the above, that's probably not a good idea.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]