In article <[email protected]>, Alan Barrett <[email protected]> wrote: >> also, EINVAL doesn't seem like a great error code for this >> condition. it's not an input parameter that's causing the >> error, but rather that the required output format cannot express >> the data to be returned. I think solaris uses EOVERFLOW for >> this kind of situation, and ERANGE doesn't seem too bad either. >> any opinions on that? > >There's also E2BIG, but I don't think it fits. ERANGE is >documented in terms of "the available space", while EOVERFLOW is >documented in terms of "a numeric result". So perhaps EOVERFLOW >for "integer is too large to fit in N bits", and ERANGE for >"string is too long to fit in N bytes"? Or vice versa? > >Somebody(TM) should go through the errno(2) documentation and make >the descriptions more generic, and add guidance for choosing which >code to return.
We need to be careful here because the set of errnos returned by many syscalls is fixed by POSIX etc. christos
