tech-userlevel archive

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

Re: S_IFMT not mentioned in any man page

On Mon, Jan 11, 2016 at 09:41:42AM -0500, Mouse wrote:
 > > Well you are not free to choose where and how the mode bits are
 > > stored, they have to be in the single field st_mode or what and must
 > > be diggable with a simple mask.
 > Yes, but only at the API.  Nothing says they have to be stored together
 > on disk - indeed, nothing says they have to be stored at all, if they
 > can be derived from something else.  And, no matter what your
 > S_FILETYPE() looks like, every filesystem implementation would have to
 > conform to it, so you really wouldn't've gained much.

"The file type goes in the upper bits of st_mode" is somewhat untidy
but it's so deeply ingrained that there's no point worrying about it.

 > > Well i'm all for freedom but that also means freedom of implementors,
 > > here they have deal with a very hard and complicated task.  Just
 > > recall all that struct stat mess, with stat64 etc.
 > What's stat64?  I just did a search through /sys on my most recent
 > NetBSD rev (5.2) and the only occurrences of "stat64" I found anywhere
 > were in compat/.

It's a linuxism arising from their not understanding how to handle
off_t correctly.

David A. Holland

Home | Main Index | Thread Index | Old Index