* sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__clone):
authorJakub Jelinek <jakub@redhat.com>
Thu, 16 Aug 2007 19:44:26 +0000 (19:44 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 16 Aug 2007 19:44:26 +0000 (19:44 +0000)
If the syscall fails, set errno to the actual returned error number
rather than EINVAL.
* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (__clone): If
arguments are incorrect, set errno to EINVAL, if the syscall
fails, set errno to the actual returned error number.
* sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__clone):
If the syscall fails, set errno to the actual returned error number
rather than EINVAL.
* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (__clone): If
arguments are incorrect, set errno to EINVAL, if the syscall
fails, set errno to the actual returned error number.

ChangeLog
sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
sysdeps/unix/sysv/linux/sparc/sparc64/clone.S

index 86046af..a3a3d62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
 
+       * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__clone):
+       If the syscall fails, set errno to the actual returned error number
+       rather than EINVAL.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (__clone): If
+       arguments are incorrect, set errno to EINVAL, if the syscall
+       fails, set errno to the actual returned error number.
+
        * stdlib/bits/stdlib-ldbl.h (__strtold_internal): Remove.
        * wcsmbs/bits/wchar-ldbl.h (__wcstold_internal): Remove.
 
index 1e099cc..a64d8e5 100644 (file)
@@ -41,9 +41,9 @@ ENTRY (__clone)
 
        /* sanity check arguments */
        orcc    %i0,%g0,%g2
-       be      .Lerror
+       be      .Leinval
         orcc   %i1,%g0,%o1
-       be      .Lerror
+       be      .Leinval
         mov    %i2,%o0
 
        /* The child_stack is the top of the stack, allocate one
@@ -70,9 +70,11 @@ ENTRY (__clone)
        jmpl    %i7 + 8, %g0
         restore %o0,%g0,%o0
 
+.Leinval:
+       mov     EINVAL, %o0
 .Lerror:
        call    HIDDEN_JUMPTARGET(__errno_location)
-        or     %g0,EINVAL,%i0
+        mov    %o0, %i0
        st      %i0,[%o0]
        jmpl    %i7 + 8, %g0
         restore %g0,-1,%o0
index b1dcc91..2bbbd80 100644 (file)
@@ -62,33 +62,16 @@ ENTRY (__clone)
        /* Do the system call */
        set     __NR_clone, %g1
        ta      0x6d
-       bcs,pn  %xcc, 99f
+       bcs,pn  %xcc, 98f
         nop
        brnz,pn %o1, __thread_start
         nop
        jmpl    %i7 + 8, %g0
         restore %o0, %g0, %o0
-99:
-#ifndef _LIBC_REENTRANT
-#ifdef PIC
-       call    1f
-       sethi   %hi(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
-1:     or      %l7, %lo(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
-       add     %l7, %o7, %l7
-       set     EINVAL, %i0
-       sethi   %hi(errno), %g2
-       or      %g2, %lo(errno), %g2
-       st      %i0, [%l7+%g2]
-#else
-       sethi   %hi(errno), %g2
-       set     EINVAL, %i0
-       st      %i0, [%g2+%lo(errno)]
-#endif
-#else
-       call    HIDDEN_JUMPTARGET(__errno_location)
-        nop
+99:    mov     EINVAL, %o0
+98:    call    HIDDEN_JUMPTARGET(__errno_location)
+        mov    %o0, %i0
        st      %i0, [%o0]
-#endif
        jmpl    %i7 + 8, %g0
         restore %g0,-1,%o0
 END(__clone)