lib: c: pthread: implement per-thread errno storage

This commit is contained in:
2026-03-22 19:09:18 +00:00
parent dd46a378b3
commit a792bbe5db
2 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
#include "pthread.h"
#include <mango/log.h>
#include <pthread.h>
#include <stdio.h>
int *__errno_location(void)
{
struct __pthread *self = pthread_self();
kern_logf("using pthread errno %p", &self->thr_errno);
return &self->thr_errno;
}