From: Markos Chandras <[email protected]>

Signed-off-by: Markos Chandras <[email protected]>
---
 libc/sysdeps/linux/common/vfork.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/libc/sysdeps/linux/common/vfork.c 
b/libc/sysdeps/linux/common/vfork.c
index e7c9208..377418c 100644
--- a/libc/sysdeps/linux/common/vfork.c
+++ b/libc/sysdeps/linux/common/vfork.c
@@ -4,13 +4,27 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
+#include <signal.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
 
 extern __typeof(vfork) __vfork attribute_hidden;
 
-#ifdef __NR_vfork
+#if defined(__NR_fork) && !defined(__NR_vfork)
+pid_t __vfork(void)
+{
+       pid_t pid = INLINE_SYSCALL(fork, 0);
+
+       if (pid<0)
+               return -1
+
+       return pid;
+}
+weak_alias(__vfork, vfork)
+libc_hidden_weak(vfork)
+
+#elif defined(__NR_vfork)
 
 # define __NR___vfork __NR_vfork
 _syscall0(pid_t, __vfork)
-- 
1.8.0


_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to