lib: c: pthread: implement per-thread errno storage
This commit is contained in:
12
lib/libc/pthread/thread/errno.c
Normal file
12
lib/libc/pthread/thread/errno.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user