summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-05-12 23:45:07 -0400
committerRich Felker <dalias@aerifal.cx>2012-05-12 23:45:07 -0400
commite68c51ac46a9f273927aef8dcebc89912ab19ece (patch)
tree908d275523ca6e4a336769a3a5fc4d12ff788df6 /src
parent3777f5b90d25b2cafc5fd7be57580f1925fb5515 (diff)
downloadmusl-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 'src')
-rw-r--r--src/network/h_errno.c8
-rw-r--r--src/network/res_query.c1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/network/h_errno.c b/src/network/h_errno.c
index 73ead046..5560234c 100644
--- a/src/network/h_errno.c
+++ b/src/network/h_errno.c
@@ -1 +1,9 @@
+#include <netdb.h>
+
+#undef h_errno;
int h_errno;
+
+int *__h_errno_location(void)
+{
+ return &h_errno;
+}
diff --git a/src/network/res_query.c b/src/network/res_query.c
index 42009992..c3ad1090 100644
--- a/src/network/res_query.c
+++ b/src/network/res_query.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
#include <netdb.h>
#include "__dns.h"
#include "libc.h"