summaryrefslogtreecommitdiffstats
path: root/libc/inet/resolv.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-12-08 04:53:18 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-12-08 04:53:18 +0000
commit2efb2ef4f916151b8abe51fc87ed7b5411d1d91e (patch)
treede3810184b137dfffeda00de1f25e89b72424218 /libc/inet/resolv.c
parenta920808b219ce74ae7e5e3f52bcbfe67884c5087 (diff)
downloaduClibc-alpine-2efb2ef4f916151b8abe51fc87ed7b5411d1d91e.tar.bz2
uClibc-alpine-2efb2ef4f916151b8abe51fc87ed7b5411d1d91e.tar.xz
Replace NPTL needed code.
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r--libc/inet/resolv.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index af38c14a5..0e7c4d8b8 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1127,11 +1127,22 @@ struct hostent *gethostbyname2(const char *name, int family)
#ifdef L_res_init
+#undef _res
struct __res_state _res;
+struct __res_state * weak_const_function __res_state (void)
+{
+ return &_res;
+}
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <tls.h>
+__thread struct __res_state *__resp = &_res;
+#endif
+
int res_init(void)
{
- struct __res_state *rp = &(_res);
+ struct __res_state *rp = __res_state();
__close_nameservers();
__open_nameservers();