simplify multi-threaded errno, eliminate useless function pointer
[musl] / src / errno / __errno_location.c
1 #include "pthread_impl.h"
2
3 int *__errno_location(void)
4 {
5         static int e;
6         if (libc.main_thread) return __pthread_self()->errno_ptr;
7         return &e;
8 }