LibC: Update thread id on fork

This commit is contained in:
Bananymous 2025-08-03 19:33:45 +03:00
parent f197d39aaf
commit d25a5034db
1 changed files with 3 additions and 0 deletions

View File

@ -518,6 +518,9 @@ static pthread_mutex_t s_atfork_mutex = PTHREAD_MUTEX_INITIALIZER;
void _pthread_call_atfork(int state) void _pthread_call_atfork(int state)
{ {
if (state == _PTHREAD_ATFORK_CHILD)
_get_uthread()->id = syscall(SYS_PTHREAD_SELF);
pthread_mutex_lock(&s_atfork_mutex); pthread_mutex_lock(&s_atfork_mutex);
pthread_atfork_t* list = nullptr; pthread_atfork_t* list = nullptr;