Skip to content

Commit

Permalink
pthread_at_fork: bogus implementation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Glauber Costa committed Apr 9, 2014
1 parent f36d39a commit 73bd131
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions libc/pthread.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -180,9 +180,25 @@ int pthread_key_create(pthread_key_t* key, void (*dtor)(void*))
return 0; return 0;
} }


extern "C" int pthread_atfork(void (*prepare)(void), void (*parent)(void),
int __pthread_key_create(pthread_key_t* key, void (*dtor)(void*)) void (*child)(void))
__attribute__((alias("pthread_key_create"))); {
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) int pthread_key_delete(pthread_key_t key)
{ {
Expand Down

1 comment on commit 73bd131

@MannySchneck
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

Please sign in to comment.