Re: access() says EROFS even for device files if /dev is mounted RO

From: Alexander Viro (viro@math.psu.edu)
Date: Wed Nov 29 2000 - 11:18:26 EST


On Wed, 29 Nov 2000, Hugh Dickins wrote:

> Sorry, I missed the point at issue here, and what changed when.
> Assuming (perhaps wrongly) it's independent of filesystem type,
>
> Solaris yes ok ok
> HP-UX yes EROFS ok
>
> I don't have UnixWare or OpenServer at hand to test,
> guess UnixWare as Solaris, can report OpenServer tomorrow.
> But it looks like a Floridan answer.

It looks like

        AT&T versions up to SysIII (at least), all UCB versions, Ultrix,
4.4BSD-derived systems, Solaris, pre-2.2.6 Linux, current 2.4.* Linux:
if access() says EROFS - open() will also fail with EROFS.

HP-UX and 2.2.6-2.2.18-pre*: give false alarm on access() even though they
allow open().

I would say that the latter group is badly outnumbered _and_ broken. It's one
thing when standard sets the bogus historical behaviour in stone, but
here we introduced bogus behaviour due to misreading the vague language
used in standard. Historically, on systems that allow write access to devices
on r/o filesystems access() doesn't return EROFS for devices. Moreover, that's
what one might reasonably expect and there are programs relying on that.
Principle of minimal surprise and all such...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Nov 30 2000 - 21:00:22 EST