From 0f40e2b464119e3c36a0f35ee93cfadecade2cd7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 9 Jul 2005 00:57:49 +0000 Subject: import the __syscall_error trick for errno handling --- libc/sysdeps/linux/sparc/clone.S | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'libc/sysdeps/linux/sparc/clone.S') 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 #include /* 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 -- cgit v1.2.3