From 1e85d9e01030c7d841ad00d3b044b6ad1bf06011 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 8 Jul 2008 02:41:21 +0000 Subject: New .config option UCLIBC_HAS_STUBS, enables fork() stub on NOMMU --- libc/sysdeps/linux/common/fork.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/fork.c b/libc/sysdeps/linux/common/fork.c index b67cba05a..b4fa3686d 100644 --- a/libc/sysdeps/linux/common/fork.c +++ b/libc/sysdeps/linux/common/fork.c @@ -11,6 +11,7 @@ #include #ifdef __ARCH_USE_MMU__ + #ifdef __NR_fork extern __typeof(fork) __libc_fork; #define __NR___libc_fork __NR_fork @@ -19,4 +20,17 @@ libc_hidden_proto(fork) weak_alias(__libc_fork,fork) libc_hidden_weak(fork) #endif + +#elif defined __UCLIBC_HAS_STUBS__ + +pid_t __libc_fork(void) +{ + __set_errno(ENOSYS); + return -1; +} +libc_hidden_proto(fork) +weak_alias(__libc_fork,fork) +libc_hidden_weak(fork) +link_warning(fork, "fork: this function is not implemented on no-mmu systems") + #endif -- cgit v1.2.3