Index: lib/libc/gen/pthread_atfork.c =================================================================== RCS file: /cvsroot/src/lib/libc/gen/pthread_atfork.c,v retrieving revision 1.10 diff -u -r1.10 pthread_atfork.c --- lib/libc/gen/pthread_atfork.c 20 Jan 2015 18:31:25 -0000 1.10 +++ lib/libc/gen/pthread_atfork.c 1 Feb 2020 11:40:28 -0000 @@ -36,10 +36,12 @@ #include "namespace.h" +#include +#include +#include #include #include #include -#include #include "reentrant.h" #ifdef __weak_alias @@ -73,11 +75,15 @@ static struct atfork_callback * af_alloc(void) { + void *arena; if (atfork_builtin.fn == NULL) return &atfork_builtin; - return malloc(sizeof(atfork_builtin)); + arena = mmap(NULL, sizeof(atfork_builtin), PROT_READ|PROT_WRITE, MAP_ANON, -1, 0); + if (arena == MAP_FAILED) + return NULL; + return arena; } static void @@ -85,7 +91,7 @@ { if (af != &atfork_builtin) - free(af); + munmap(af, sizeof(atfork_builtin)); } int Index: lib/libpthread/pthread_mutex.c =================================================================== RCS file: /cvsroot/src/lib/libpthread/pthread_mutex.c,v retrieving revision 1.72 diff -u -r1.72 pthread_mutex.c --- lib/libpthread/pthread_mutex.c 31 Jan 2020 17:52:14 -0000 1.72 +++ lib/libpthread/pthread_mutex.c 1 Feb 2020 11:40:30 -0000 @@ -122,7 +122,7 @@ { uintptr_t type, proto, val, ceil; -#if 0 +#if 1 /* * Always initialize the mutex structure, maybe be used later * and the cost should be minimal. @@ -619,7 +619,7 @@ int pthread_mutexattr_init(pthread_mutexattr_t *attr) { -#if 0 +#if 1 if (__predict_false(__uselibcstub)) return __libc_mutexattr_init_stub(attr); #endif