From 5deaf349d32208d6b1cad2363109a24d88b293bb Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Wed, 17 Aug 2005 20:04:05 +0000 Subject: Make uClibc vfork() use kernels vfork() instead of fork(). --- libc/sysdeps/linux/powerpc/Makefile | 4 ++-- libc/sysdeps/linux/powerpc/vfork.S | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 libc/sysdeps/linux/powerpc/vfork.S 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 + +#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 -- cgit v1.2.3