diff --git a/src/internal/fork_impl.h b/src/internal/fork_impl.h index ae3a79e5..354e733b 100644 --- a/src/internal/fork_impl.h +++ b/src/internal/fork_impl.h @@ -16,3 +16,4 @@ extern hidden volatile int *const __vmlock_lockptr; hidden void __malloc_atfork(int); hidden void __ldso_atfork(int); +hidden void __pthread_key_atfork(int); diff --git a/src/process/fork.c b/src/process/fork.c index 80e804b1..56f19313 100644 --- a/src/process/fork.c +++ b/src/process/fork.c @@ -37,6 +37,7 @@ static void dummy(int x) { } weak_alias(dummy, __fork_handler); weak_alias(dummy, __malloc_atfork); weak_alias(dummy, __aio_atfork); +weak_alias(dummy, __pthread_key_atfork); weak_alias(dummy, __ldso_atfork); static void dummy_0(void) { } @@ -51,6 +52,7 @@ pid_t fork(void) int need_locks = libc.need_locks > 0; if (need_locks) { __ldso_atfork(-1); + __pthread_key_atfork(-1); __aio_atfork(-1); __inhibit_ptc(); for (int i=0; i