mirror of https://git.musl-libc.org/git/musl
Browse Source
the framework to do this always existed but it was deemed unnecessary because the only [ex-]standard functions using h_errno were not thread-safe anyway. however, some of the nonstandard res_* functions are also supposed to set h_errno to indicate the cause of error, and were unable to do so because it was not thread-safe. this change is a prerequisite for fixing them.master
2 changed files with 3 additions and 4 deletions
@ -1,9 +1,7 @@ |
|||
#include <netdb.h> |
|||
|
|||
#undef h_errno |
|||
int h_errno; |
|||
#include "pthread_impl.h" |
|||
|
|||
int *__h_errno_location(void) |
|||
{ |
|||
return &h_errno; |
|||
return &__pthread_self()->h_errno_val; |
|||
} |
|||
|
|||
Loading…
Reference in new issue