There is not possible to use use fork() on noMMU target, so exporting
pthread_atfork() for such target is useless.
A program using pthread_atfork() will likely fail at runtime due to the
error code returned by this function.
Signed-off-by: Romain Naour <romain.naour(a)gmail.com>
---
libpthread/linuxthreads/ptfork.c | 14 --------------
libpthread/linuxthreads/sysdeps/pthread/pthread.h | 2 ++
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/libpthread/linuxthreads/ptfork.c b/libpthread/linuxthreads/ptfork.c
index 6f1e2d3..74d6308 100644
--- a/libpthread/linuxthreads/ptfork.c
+++ b/libpthread/linuxthreads/ptfork.c
@@ -150,18 +150,4 @@ static pid_t __fork(void)
strong_alias(__fork,fork)
strong_alias(__fork,vfork)
-#else
-
-/* We can't support pthread_atfork without MMU, since we don't have
- fork(), and we can't offer the correct semantics for vfork(). */
-int pthread_atfork(void (*prepare)(void),
- void (*parent)(void),
- void (*child)(void))
-{
- /* ENOMEM is probably pushing it a little bit.
- Take it as `no *virtual* memory' :-) */
- errno = ENOMEM;
- return -1;
-}
-
#endif
diff --git a/libpthread/linuxthreads/sysdeps/pthread/pthread.h
b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
index cc13a52..0d17502 100644
--- a/libpthread/linuxthreads/sysdeps/pthread/pthread.h
+++ b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
@@ -697,6 +697,7 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,
/* Functions for handling process creation and process execution. */
+#ifdef __ARCH_USE_MMU__
/* Install handlers to be called when a new process is created with FORK.
The PREPARE handler is called in the parent process just before performing
FORK. The PARENT handler is called in the parent process just after FORK.
@@ -711,6 +712,7 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,
extern int pthread_atfork (void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void)) __THROW;
+#endif
/* Terminate all threads in the program except the calling process.
Should be called just before invoking one of the exec*() functions. */
--
2.5.5