LibC: Make h_errno thread-local

This commit is contained in:
Michał Lach 2022-05-10 12:58:55 +02:00 committed by Andreas Kling
parent 0aee2abda7
commit bc18fa75ec
2 changed files with 8 additions and 0 deletions

View file

@ -19,7 +19,11 @@
extern "C" {
#ifdef NO_TLS
int h_errno;
#else
__thread int h_errno;
#endif
static hostent __gethostbyname_buffer;
static in_addr_t __gethostbyname_address;

View file

@ -48,7 +48,11 @@ struct protoent* getprotobynumber(int proto);
struct protoent* getprotoent(void);
void setprotoent(int stay_open);
#ifdef NO_TLS
extern int h_errno;
#else
extern __thread int h_errno;
#endif
#define HOST_NOT_FOUND 101
#define NO_DATA 102