#include "pthread.h" #include #include #include int *__errno_location(void) { struct __pthread *self = pthread_self(); kern_logf("using pthread errno %p", &self->thr_errno); return &self->thr_errno; }