> There is still some more real nastiness with EWOULDBLOCK.  In
> 4.3BSD, EAGAIN is 11, while EWOULDBLOCK is 35 & EDEADLK is 80.
> In 4.4bsd, EWOULDBLOCK is EAGAIN is 35, & EDEADLK is 11.
> Various other vendors have adapted other slightly different
> conventions for folding in EGAIN/EWOULDBLOCK/EDEADLK.
> In Solaris, EAGAIN & EWOULDBLOCK are 11, while EDEADLK is 45.
> In AIX, like solaris, EAGAIN & EWOULDBLOCK are in fact really
> both 11 & EDEADLK is 45.  That interesting error code that jhutz
> found, 54, is reserved for EWOULDBLOCK, but only to allow case
> statements to compile without error; the kernel isn't supposed
> to actually return that value.  My guess is that because some systems
> fold error codes together, there isn't any really fair way to
> return the same value everywhere, and the cache manager
> may just have to to learn to handle a few well-chosen
> error codes, carefully coordinated with the logic in
> rx_errconvert.c and very likely in the fileserver proper as well.


I think this problem is what Craig was describing.  Not only are the
values different from one system to another, but so are the semantics
of the calls.

> I suppose the "right" solution would be to reserve the first
> numbers starting at 1 for "network" error codes, then reserve
> another range for unrecognized OS specific errors.  The error code
> mapping functions could then map "supported" OS specific error
> codes to to the "network" range starting at 1.  *Most* OS's
> seem to agree on the first few error codes, so the "network"
> range could be defined to be the "most popular" first few values.
> For particular applications such as the fileserver, which
> may need to force a particular network error code even when
> the local OS doesn't necessarily distinguish codes (EWOULDBLOCK/EAGAIN),
> it may also be necessary to have a 3rd range.

com_err already reserves the first 255 error codes for "system" errors
(i.e. errno values).  My suggestion would be to take _all_ errors that
can occur between the fileserver and client, and define "standard"
names for them, in a separate block of com_err error codes.  Doing this
right would require changes across a couple of versions of AFS, but it
is doable.  I would continue to reserve the first 255 for errors actually
generated on the local system.

-- Jeff

Reply via email to