A number of programs, such as busybox, contain calls to fork which may
not necessarily get executed at runtime.  On nommu systems, this
currently produces link errors since the function doesn't exist.

In our Blackfin tree, we use the following patch (by Mike IIRC) to
convert the link error into a warning.  Any objections to installing this?


Bernd
-- 
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
Index: libc/sysdeps/linux/common/fork.c
===================================================================
--- libc/sysdeps/linux/common/fork.c	(revision 20945)
+++ libc/sysdeps/linux/common/fork.c	(working copy)
@@ -15,8 +15,15 @@
 extern __typeof(fork) __libc_fork;
 #define __NR___libc_fork __NR_fork
 _syscall0(pid_t, __libc_fork);
+#endif
+#else
+pid_t __libc_fork(void)
+{
+	__set_errno(ENOSYS);
+	return -1;
+}
+#endif
 libc_hidden_proto(fork)
 weak_alias(__libc_fork,fork)
 libc_hidden_weak(fork)
-#endif
-#endif
+link_warning(fork, "fork: this function is not implemented on no-mmu systems")
Index: include/unistd.h
===================================================================
--- include/unistd.h	(revision 20945)
+++ include/unistd.h	(working copy)
@@ -715,12 +715,10 @@ extern int setresgid (__gid_t __rgid, __
 #endif
 
 
-#ifdef __ARCH_USE_MMU__
 /* Clone the calling process, creating an exact copy.
    Return -1 for errors, 0 to the new process,
    and the process ID of the new process to the old process.  */
 extern __pid_t fork (void) __THROW;
-#endif
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Clone the calling process, but without copying the whole address space.
_______________________________________________
uClibc mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to