Make system() and popen() thread safe

This commit is contained in:
Justine Tunney 2022-10-13 15:38:31 -07:00
parent 997ce29ddc
commit f52f65b2e3
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
19 changed files with 135 additions and 31 deletions

View file

@ -1315,6 +1315,13 @@ int dlposix_memalign(void** pp, size_t alignment, size_t bytes) {
}
}
#if USE_LOCKS
void dlmalloc_atfork(void) {
bzero(&gm->mutex, sizeof(gm->mutex));
bzero(&malloc_global_mutex, sizeof(malloc_global_mutex));
}
#endif
void* dlvalloc(size_t bytes) {
size_t pagesz;
ensure_initialization();