| Geoff Clare 2007-07-10, 1:23 pm |
| Scott Lurndal wrote:
> Per POSIX:
>
> [EACCES]
> Search permission is denied on a component of the path prefix,
> or the file exists and the permissions specified by oflag are denied,
> or the file does not exist and write permission is denied for the parent
> directory of the file to be created, or O_TRUNC is specified and write
> permission is denied.
>
> [EROFS]
> The named file resides on a read-only file system and either O_WRONLY,
> O_RDWR, O_CREAT (if the file does not exist), or O_TRUNC is set in
> the oflag argument.
>
> Note that either _could_ apply in this case, but I believe the intent of POSIX
> is that EROFS should take precedence.
What makes you believe that is the intent?
POSIX has a general rule that there is no precedence between errors.
XSH section 2.3 Error Numbers:
"If more than one error occurs in processing a function call, any
one of the possible errors may be returned, as the order of
detection is undefined."
--
Geoff Clare <netnews@gclare.org.uk>
|