[klibc] klibc: s390 errno...

Heiko Carstens heiko.carstens at de.ibm.com
Tue May 2 00:50:18 PDT 2006


On Mon, May 01, 2006 at 10:58:16AM -0700, H. Peter Anvin wrote:
> I'm trying to do a full rebase (history clean) of the klibc kernel tree, and came across the following changesets between klibc 1.3.12 and .16:
> 
> --- a/usr/klibc/arch/s390/syscall.c
> +++ b/usr/klibc/arch/s390/syscall.c
> @@ -11,6 +11,6 @@ long int __syscall_common(long int err)
>  {
>         if ((unsigned long)(err) < (unsigned long)(-125))
>                 return err;
> -       errno = err;
> +       errno = -err;
>         return -1;
>  }
> diff --git a/usr/klibc/arch/s390x/syscall.c b/usr/klibc/arch/s390x/syscall.c
> index 0d6b27e..c0f17c4 100644
> --- a/usr/klibc/arch/s390x/syscall.c
> +++ b/usr/klibc/arch/s390x/syscall.c
> @@ -11,6 +11,6 @@ long int __syscall_common(long int err)
>  {
>         if ((unsigned long)(err) < (unsigned long)(-125))
>                 return err;
> -       errno = -err;
> +       errno = err;
>         return -1;
>  }
> 
> 
> 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.



More information about the klibc mailing list