tech-kern archive

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

Re: Use consistent errno for read(2) failure on directories

On Sat, Dec 10, 2011 at 12:06:18PM -0500, Mouse wrote:
> >> According to the online OpenGroup specification for read(2)
> >> available at [1], read(2) on directories is implementation
> >> dependant.  If unsupported, it shall fail with EISDIR.
> >> Not all our file systems comply, and return random errno values in
> >> this case (mostly EINVAL or ENOTSUP).
> How does that not comply with "implementation dependent"?  From a
> standards-conformance point of view, that's equivalent to "in this
> implementation, read(2) on directories is supported: on $FILESYSTEM, it
> always returns EINVAL, on $OTHER_FILESYSTEM, it works according to
> This is not to say that it shouldn't be cleaned up.  Just that I don't
> think it's actually nonconformant.

Actually, it's filesystem implementation dependant to allow read(2) on
directories; and if the implementation does not support it, it should
fail with EISDIR.

Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.

Home | Main Index | Thread Index | Old Index