summaryrefslogtreecommitdiff
path: root/include/resolv.h
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2009-09-19 09:54:20 -0700
committerAustin Foxley <austinf@cetoncorp.com>2009-09-26 09:26:28 -0700
commitd21497f9fba95688e464ae712bd6b4c0fbc4ea13 (patch)
treec6fb7dbd153266214843d5057672b49a22fc10d2 /include/resolv.h
parent18cc8e0e459edf5391016ef76a4ff3108981d86a (diff)
include/: add tls errno and res_state
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'include/resolv.h')
-rw-r--r--include/resolv.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/include/resolv.h b/include/resolv.h
index fc2fa9b99..e0cd35db1 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -279,14 +279,10 @@ struct res_sym {
/* 0x00008000 */
/* Things involving an internal (static) resolver context. */
-#if 0
__BEGIN_DECLS
extern struct __res_state *__res_state(void) __attribute__ ((__const__));
__END_DECLS
#define _res (*__res_state())
-#else
-extern struct __res_state _res;
-#endif
#define fp_nquery __fp_nquery
#define fp_query __fp_query
@@ -425,6 +421,24 @@ int res_nsend (res_state, const u_char *, int, u_char *, int)
__THROW;
void res_nclose (res_state) __THROW;
__END_DECLS
-#endif
+
+# if _LIBC
+# ifdef __UCLIBC_HAS_THREADS__
+# if defined __UCLIBC_HAS_TLS__ \
+ && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# undef _res
+# ifndef NOT_IN_libc
+# define __resp __libc_resp
+# endif
+# define _res (*__resp)
+extern __thread struct __res_state *__resp attribute_tls_model_ie;
+# endif
+# else
+# undef _res
+# define _res (*__resp)
+extern struct __res_state *__resp;
+# endif /* __UCLIBC_HAS_TLS__ */
+# endif /* __UCLIBC_HAS_THREADS__ */
+# endif /* _LIBC */
#endif /* !_RESOLV_H_ */