[uClibc] [PATCH] make uClibc vfork() on PPC use kernel vfork()instead of fork()

Joakim Tjernlund joakim.tjernlund at lumentis.se
Wed Aug 17 14:46:10 UTC 2005


> 
> This patch fixes the the current vfork() impl. for
> PPC to actually use the kernel vfork system call instead of fork()
> 
> Extra bonus: Remove unused system call file, syscall.S, in Makefile.

Oops, syscall.S isn't unused after all.

> 
> Since the release of .28 is very close I wan't Eriks blessing before
> checking this in. A little extra testing would be good as well.
> 
>  Jocke

Here is a fixed patch:
Index: vfork.S
===================================================================
--- vfork.S	(revision 0)
+++ vfork.S	(revision 0)
@@ -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, at function
+.type   __syscall_error, at function
+
+__vfork:
+	li	0, __NR_vfork
+	sc
+	bnslr+
+	b	__syscall_error
+.size __vfork,.-__vfork
+
+.weak vfork ; vfork = __vfork
+#endif
Index: Makefile
===================================================================
--- Makefile	(revision 11171)
+++ Makefile	(working copy)
@@ -25,10 +25,10 @@
 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)




More information about the uClibc mailing list