summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/sparc/clone.S
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-07-09 00:57:49 +0000
committerMike Frysinger <vapier@gentoo.org>2005-07-09 00:57:49 +0000
commit0f40e2b464119e3c36a0f35ee93cfadecade2cd7 (patch)
tree0bac8fbc688aa9dd8f641e99f8f56f050e16c9ae /libc/sysdeps/linux/sparc/clone.S
parentc7f096da1a44a7811f820ea7f888d616b7c3f5f7 (diff)
import the __syscall_error trick for errno handling
Diffstat (limited to 'libc/sysdeps/linux/sparc/clone.S')
-rw-r--r--libc/sysdeps/linux/sparc/clone.S15
1 files changed, 5 insertions, 10 deletions
diff --git a/libc/sysdeps/linux/sparc/clone.S b/libc/sysdeps/linux/sparc/clone.S
index 1bd10561a..7421ef672 100644
--- a/libc/sysdeps/linux/sparc/clone.S
+++ b/libc/sysdeps/linux/sparc/clone.S
@@ -20,7 +20,6 @@
/* clone() is even more special than fork() as it mucks with stacks
and invokes a function in the right context after its all over. */
-#include <asm/errno.h>
#include <asm/unistd.h>
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
@@ -35,27 +34,23 @@ __clone:
/* sanity check arguments */
tst %i0
- be .Lerror
+ be __error
orcc %i1,%g0,%o1
- be .Lerror
+ be __error
mov %i2,%o0
/* Do the system call */
set __NR_clone,%g1
ta 0x10
- bcs .Lerror
+ bcs __error
tst %o1
bne __thread_start
nop
ret
restore %o0,%g0,%o0
-.Lerror:
- call __errno_location
- or %g0,EINVAL,%i0
- st %i0,[%o0]
- ret
- restore %g0,-1,%o0
+__error:
+ jmp __syscall_error
.size __clone,.-__clone