[git commit nptl] create real common vfork() function

Mike Frysinger vapier at gentoo.org
Wed Aug 19 11:29:41 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=f8d6a799aeeb2cd9648440f693105c2febc84eb8
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/nptl

Rather than force people to always implement their own vfork(), have the
default implementation be sane.

For now, only the Blackfin port uses the new code.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 libc/sysdeps/linux/bfin/Makefile.arch |    2 +-
 libc/sysdeps/linux/bfin/vfork.S       |   20 --------------------
 libc/sysdeps/linux/common/vfork.c     |   20 +++++++++++++-------
 3 files changed, 14 insertions(+), 28 deletions(-)
 delete mode 100644 libc/sysdeps/linux/bfin/vfork.S

diff --git a/libc/sysdeps/linux/bfin/Makefile.arch b/libc/sysdeps/linux/bfin/Makefile.arch
index f74e41d..2427037 100644
--- a/libc/sysdeps/linux/bfin/Makefile.arch
+++ b/libc/sysdeps/linux/bfin/Makefile.arch
@@ -8,6 +8,6 @@
 CSRC := bsdsetjmp.c clone.c \
 	sram-alloc.c sram-free.c dma-memcpy.c
 
-SSRC := __longjmp.S setjmp.S bsd-_setjmp.S vfork.S
+SSRC := __longjmp.S setjmp.S bsd-_setjmp.S
 
 ARCH_HEADERS := bfin_fixed_code.h bfin_l1layout.h bfin_sram.h
diff --git a/libc/sysdeps/linux/bfin/vfork.S b/libc/sysdeps/linux/bfin/vfork.S
deleted file mode 100644
index 4e9aa84..0000000
--- a/libc/sysdeps/linux/bfin/vfork.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2000-2006 Erik Andersen <andersen at uclibc.org>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-#include <sys/syscall.h>
-
-.text
-.global ___vfork
-.hidden ___vfork
-.type	___vfork,STT_FUNC;
-.align 4
-___vfork:
-	p0 = __NR_vfork;
-	excpt 0;
-	rts;
-.size ___vfork,.-___vfork
-weak_alias(__vfork,vfork)
-libc_hidden_weak(vfork)
diff --git a/libc/sysdeps/linux/common/vfork.c b/libc/sysdeps/linux/common/vfork.c
index eda76ae..e7c9208 100644
--- a/libc/sysdeps/linux/common/vfork.c
+++ b/libc/sysdeps/linux/common/vfork.c
@@ -4,24 +4,30 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* Trivial implementation for arches that lack vfork */
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
 
-#ifdef __ARCH_USE_MMU__
+extern __typeof(vfork) __vfork attribute_hidden;
 
-#ifdef __NR_fork
-/* libc_hidden_proto(fork) */
+#ifdef __NR_vfork
+
+# define __NR___vfork __NR_vfork
+_syscall0(pid_t, __vfork)
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
+
+#elif defined __ARCH_USE_MMU__ && defined __NR_fork
+
+/* Trivial implementation for arches that lack vfork */
 
-extern __typeof(vfork) __vfork attribute_hidden;
 pid_t __vfork(void)
 {
     return fork();
 }
-/* libc_hidden_proto(vfork) */
+
 weak_alias(__vfork,vfork)
 libc_hidden_weak(vfork)
-#endif
 
 #endif
-- 
1.6.3.3



More information about the uClibc-cvs mailing list