[klibc] klibc: s390 errno...
heiko.carstens at de.ibm.com
Tue May 2 01:06:59 PDT 2006
On Tue, May 02, 2006 at 01:53:04AM -0700, H. Peter Anvin wrote:
> Heiko Carstens wrote:
> >>The former is clearly right and the latter is clearly wrong. Should I change the s390x version to match s390?
> >Looks like the right thing to do. Even though -125 seems to be wrong since we
> >have already
> >#define ENOTRECOVERABLE 131 /* State not recoverable */
> >Testing against -4095 is probably better.
> I like -4096 better; that way it's effectively an "error page" at the top of the unsigned space.
> Could you try it out and send me a patch? I don't have access to any s390 equipment or even simulators.
/* Linux uses a negative return value to indicate syscall errors, unlike
most Unices, which use the condition codes' carry flag.
Since version 2.1 the return value of a system call might be negative
even if the call succeeded. E.g., the `lseek' system call might return
a large offset. Therefore we must not anymore test for < 0, but test
for a real error by making sure the value in gpr2 is a real error
number. Linus said he will make sure the no syscall returns a value
in -1 .. -4095 as a valid result so we can savely test with -4095. */
>From glibc.. that's why I would use -4095 :)
I will send you a patch later.
More information about the klibc