summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/nios/vfork.S
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/nios/vfork.S')
-rw-r--r--libc/sysdeps/linux/nios/vfork.S34
1 files changed, 15 insertions, 19 deletions
diff --git a/libc/sysdeps/linux/nios/vfork.S b/libc/sysdeps/linux/nios/vfork.S
index 22b3c30cd..cf95c5a34 100644
--- a/libc/sysdeps/linux/nios/vfork.S
+++ b/libc/sysdeps/linux/nios/vfork.S
@@ -9,7 +9,11 @@
*
* Written by Wentao Xu <wentao@microtronix.com>
*/
-#include <asm/unistd.h>
+
+#include <features.h>
+
+#include <bits/errno.h>
+#include <sys/syscall.h>
#include "NM_Macros.S"
#ifndef __NR_vfork
@@ -18,15 +22,11 @@
.text
.align 2
- .globl errno
- .globl vfork
- .globl __libc_vfork
+ .globl __vfork
#if defined __HAVE_ELF__
- .type vfork,@function
- .type __libc_vfork,@function
+ .type __vfork,@function
#endif
-vfork:
-__libc_vfork:
+__vfork:
MOVIP %g1, __NR_vfork
trap 63
@@ -34,25 +34,21 @@ __libc_vfork:
not %g1 /* (unsigned long) -4096 */
cmp %o0, %g1
skps cc_hi
- jmp %o7
- nop
-
+ jmp %o7
+ nop
+
fix_errno:
neg %o0
save %sp, -16
MOVIA %g1, __errno_location@h
call %g1
- nop
+ nop
st [%o0], %i0 /* store errno */
xor %i0, %i0
subi %i0, 1 /* retval=-1 */
ret
- restore
-
-
-
-
-
-
+ restore
+.size __vfork,.-__vfork
+strong_alias(__vfork,vfork)