diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-05-12 23:45:07 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-05-12 23:45:07 -0400 |
commit | e68c51ac46a9f273927aef8dcebc89912ab19ece (patch) | |
tree | 908d275523ca6e4a336769a3a5fc4d12ff788df6 /include | |
parent | 3777f5b90d25b2cafc5fd7be57580f1925fb5515 (diff) | |
download | musl-e68c51ac46a9f273927aef8dcebc89912ab19ece.tar.gz musl-e68c51ac46a9f273927aef8dcebc89912ab19ece.tar.bz2 musl-e68c51ac46a9f273927aef8dcebc89912ab19ece.tar.xz musl-e68c51ac46a9f273927aef8dcebc89912ab19ece.zip |
use __h_errno_location for h_errno
we do not bother making h_errno thread-local since the only interfaces
that use it are inherently non-thread-safe. but still use the
potentially-thread-local ABI to access it just to avoid lock-in.
Diffstat (limited to 'include')
-rw-r--r-- | include/netdb.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/netdb.h b/include/netdb.h index a480d82f..33b7a0ab 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -128,7 +128,11 @@ struct hostent *gethostbyaddr (const void *, socklen_t, int); int gethostbyaddr_r(const void *, socklen_t, int, struct hostent *, char *, size_t, struct hostent **, int *); int getservbyport_r(int, const char *, struct servent *, char *, size_t, struct servent **); int getservbyname_r(const char *, const char *, struct servent *, char *, size_t, struct servent **); -extern int h_errno; +#ifdef __GNUC__ +__attribute__((const)) +#endif +int *__h_errno_location(void); +#define h_errno (*__h_errno_location()) #define EAI_NODATA -5 #define EAI_ADDRFAMILY -9 #define EAI_INPROGRESS -100 |