summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-07-23 04:03:17 -0400
committerAustin Foxley <austinf@cetoncorp.com>2009-08-19 12:41:53 -0700
commitf8d6a799aeeb2cd9648440f693105c2febc84eb8 (patch)
treec899a8d494d949f43c43e73239e9e4e141fae909 /libc/sysdeps/linux/common
parent44896253aab05ab2d41143337761859250f0cea4 (diff)
downloaduClibc-alpine-f8d6a799aeeb2cd9648440f693105c2febc84eb8.tar.bz2
uClibc-alpine-f8d6a799aeeb2cd9648440f693105c2febc84eb8.tar.xz
create real common vfork() function
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@gentoo.org> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/vfork.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/common/vfork.c b/libc/sysdeps/linux/common/vfork.c
index eda76aeac..e7c920892 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