Permalink
Browse files

pthread_at_fork: bogus implementation

Because we do not support fork, there is no need to do anything upon fork (and if
it changes in the future, we should revisit this)

So we can get away with this simple implementation that just returns 0.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
1 parent f36d39a commit 73bd131f4dadcd758d87ee83325746ae6900838d @glommer committed Apr 8, 2014
Showing with 19 additions and 3 deletions.
  1. +19 −3 libc/pthread.cc
View
@@ -180,9 +180,25 @@ int pthread_key_create(pthread_key_t* key, void (*dtor)(void*))
return 0;
}
-extern "C"
-int __pthread_key_create(pthread_key_t* key, void (*dtor)(void*))
- __attribute__((alias("pthread_key_create")));
+int pthread_atfork(void (*prepare)(void), void (*parent)(void),
+ void (*child)(void))
+{
+ return 0;
+}
+
+extern "C" int register_atfork(void (*prepare)(void), void (*parent)(void),
+ void (*child)(void), void *__dso_handle)
+{
+ return 0;
+}
+
+extern "C" {
+ int __register_atfork(void (*prepare)(void), void (*parent)(void),
+ void (*child)(void), void *__dso_handle) __attribute__((alias("register_atfork")));
+ int __pthread_key_create(pthread_key_t* key, void (*dtor)(void*))
+ __attribute__((alias("pthread_key_create")));
+}
+
int pthread_key_delete(pthread_key_t key)
{

0 comments on commit 73bd131

Please sign in to comment.