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

From: Rogier Wolff (R.E.Wolff@BitWizard.nl)
Date: Mon Nov 27 2000 - 16:47:06 EST


Andries Brouwer wrote:
> > access("/dev/tty2", R_OK|W_OK) = -1 EROFS (Read-only file system)

> You misunderstand the function of access(). The standard says
>
> [EROFS] write access shall fail if write access is requested
> for a file on a read-only file system

The intent of the "access" call is to tell you if you will be able to
open the given pathname for the requested permissions. That this is
inherently racey is not the fault of the access system call.

The INTENT of this paragraph from the standard is to specify when to
return the error value EROFS. The "for a -=file=-" part to me
indicates that a valid interpretation is that this does not apply to
device nodes.

                        Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 
-
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:18 EST