summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/linux/powerpc/Makefile4
-rw-r--r--libc/sysdeps/linux/powerpc/vfork.S23
2 files changed, 25 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/powerpc/Makefile b/libc/sysdeps/linux/powerpc/Makefile
index eb212bac0..4c345c00f 100644
--- a/libc/sysdeps/linux/powerpc/Makefile
+++ b/libc/sysdeps/linux/powerpc/Makefile
@@ -25,10 +25,10 @@ SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ))
CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
SSRC=__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
- clone.S __uClibc_syscall.S syscall.S
+ clone.S __uClibc_syscall.S syscall.S vfork.S
SOBJS=$(patsubst %.S,%.o, $(SSRC))
-CSRC=mmap.c vfork.c __syscall_error.c pread_write.c ioctl.c
+CSRC=mmap.c __syscall_error.c pread_write.c ioctl.c
COBJS=$(patsubst %.c,%.o, $(CSRC))
OBJS=$(SOBJS) $(COBJS)
diff --git a/libc/sysdeps/linux/powerpc/vfork.S b/libc/sysdeps/linux/powerpc/vfork.S
new file mode 100644
index 000000000..67d8aaeac
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/vfork.S
@@ -0,0 +1,23 @@
+#include <sys/syscall.h>
+
+#ifndef __NR_vfork
+
+/* No vfork so use fork instead */
+.weak vfork ; vfork = __libc_fork
+
+#else
+
+.text
+.global __vfork
+.type __vfork,@function
+.type __syscall_error,@function
+
+__vfork:
+ li 0, __NR_vfork
+ sc
+ bnslr+
+ b __syscall_error
+.size __vfork,.-__vfork
+
+.weak vfork ; vfork = __vfork
+#endif