summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/xtensa
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-21 21:49:49 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:40 +0200
commite4b5997fc1cea7eeaad155aad02b8b1997143874 (patch)
treec5da88f5f87a537913ac8506b30193bde2125d9d /libc/sysdeps/linux/xtensa
parent9df9c60aa93287211cf9698eb979d80fded765dc (diff)
fork: provide __libc_fork only if THREADS are enabled
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/xtensa')
-rw-r--r--libc/sysdeps/linux/xtensa/fork.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/xtensa/fork.c b/libc/sysdeps/linux/xtensa/fork.c
index f8b77bfb5..e9b681c67 100644
--- a/libc/sysdeps/linux/xtensa/fork.c
+++ b/libc/sysdeps/linux/xtensa/fork.c
@@ -7,16 +7,19 @@
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
-#include <unistd.h>
-#include <sys/syscall.h>
-#define _SIGNAL_H
-#include <bits/signum.h>
/* Xtensa doesn't provide a 'fork' system call, so we use 'clone'. */
+#include <sys/syscall.h>
+
+#if defined __NR_clone && defined __ARCH_USE_MMU__
+# include <unistd.h>
+# include <signal.h>
+# include <cancel.h>
-pid_t __libc_fork(void)
+pid_t fork(void)
{
return (pid_t) INLINE_SYSCALL(clone, 2, SIGCHLD, 0);
}
-weak_alias(__libc_fork, fork)
-libc_hidden_weak(fork)
+lt_strong_alias(fork)
+lt_libc_hidden(fork)
+#endif