From: Markos Chandras <markos.chand...@imgtec.com>

Signed-off-by: Markos Chandras <markos.chand...@imgtec.com>
---
 libc/sysdeps/linux/common/fork.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/libc/sysdeps/linux/common/fork.c b/libc/sysdeps/linux/common/fork.c
index 14e00a2..0b58fa9 100644
--- a/libc/sysdeps/linux/common/fork.c
+++ b/libc/sysdeps/linux/common/fork.c
@@ -9,10 +9,28 @@
 
 #include <sys/syscall.h>
 #include <unistd.h>
+#include <unistd.h>
+#include <signal.h>
 
 #ifdef __ARCH_USE_MMU__
 
-#ifdef __NR_fork
+#if defined(__NR_clone) && ! defined(__NR_fork)
+pid_t __libc_fork(void)
+{
+       pid_t pid;
+       pid = INLINE_SYSCALL(clone, 4, SIGCHLD, NULL, NULL, NULL);
+
+       if (pid<0) {
+               __set_errno(-pid);
+               return -1;
+       }
+
+       return pid;
+}
+weak_alias(__libc_fork,fork)
+libc_hidden_weak(fork)
+
+#elif defined(__NR_fork)
 #define __NR___libc_fork __NR_fork
 extern __typeof(fork) __libc_fork;
 _syscall0(pid_t, __libc_fork)
-- 
1.7.1


_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to