This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Do we really need correct st_nlink count for directories?


According to Igor Peshansky on 4/25/2008 12:38 PM:

Would it make sense to use 0 as the link count on directories? Unless I'm missing something, every directory has to have at least the '.' link, which makes 0 an obviously invalid value (that can be used to trigger the fallback code).

When link counts are accurate, every directory has a link count of at least 2 (. and ..) (in fact, the optimization is to abort the readdir() after discovering st_nlink-2 subdirs). Therefore, a link count of 1 is sufficient to trigger the fallback code.


--
Don't work too hard, make some time for fun as well!

Eric Blake ebb9@byu.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]