Browse Source

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.
Waldemar Brodkorb 6 years ago
parent
commit
9e38e0aa45
1 changed files with 12 additions and 0 deletions
  1. 12 0
      libpthread/linuxthreads/ptfork.c

+ 12 - 0
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