Re: [RFD] What error should FS return when I/O failure occurs?

Valdis.Kletnieks
2005-05-18T07:58:14Z

[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]

On Wed, 18 May 2005 13:10:24 EDT, fs said:

> For each test case, different FS returns different result.
> From user's perspective, it's really annoying, so, there should be a
> standard which constraints the error type. Otherwise, different fs
> can return whatever they want, regardless of the user's need.

Which does the user "need":

a) an 'errno' valye that's forced to be one of a specific subset of values,
even if none of them explain what's going on

or

b) an 'errno' value that actually tells you about the error?

Remember - if the *kernel* forces a -EROFS to become a -EIO, then userspace
is stuck with that value. If the kernel passes -EROFS back to userspace,
then after glibc stashes an EROFS into errno, either glibc or the application
program can insert a 'if (errno == EROFS) {errno = EIO;}' if it feels that
EROFS is unnatural.

And in any case, that's what the *application programmer* needs. What the *user*
needs is for the file to either be safely stored, or a dialog box put up saying
that it failed....

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]