summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2017-11-19 09:10:12 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2017-11-19 09:12:47 +0100
commit9e38e0aa45cca21d5023d0af94377f0e1e41d2f4 (patch)
tree9d65edd7fa9f9473a2cc6b9ada2c68ae0c523933 /libpthread/linuxthreads
parenta745c4bfc8a9b5db4e48387170da0dc1d39e3abe (diff)
linuxthreads: add dummy for pthread_atfork
For noMMU targets we need a pthread_atfork dummy, otherwise libraries like libressl using pthread_atfork, but not fork() for itself, can not be used. But software like curl with ssl support linking against libressl still work fine on noMMU targets.
Diffstat (limited to 'libpthread/linuxthreads')
-rw-r--r--libpthread/linuxthreads/ptfork.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libpthread/linuxthreads/ptfork.c b/libpthread/linuxthreads/ptfork.c
index 74d630830..a1bad3d54 100644
--- a/libpthread/linuxthreads/ptfork.c
+++ b/libpthread/linuxthreads/ptfork.c
@@ -150,4 +150,16 @@ 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().
+ But instead of failing, just provide a dummy */
+int pthread_atfork(void (*prepare)(void),
+ void (*parent)(void),
+ void (*child)(void))
+{
+ return 0;
+}
+
#endif