diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-08-12 11:18:23 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-08-12 11:18:23 +0000 |
commit | b46868ff8b3d2fb592e3fca4a516695533eae9e5 (patch) | |
tree | 09f3f841693624a20dcf7bbd2a69d08dee728323 /include/resolv.h | |
parent | 50dcba0bb24c6c57397dab0ee4a083ee2c8266aa (diff) | |
download | uClibc-alpine-b46868ff8b3d2fb592e3fca4a516695533eae9e5.tar.bz2 uClibc-alpine-b46868ff8b3d2fb592e3fca4a516695533eae9e5.tar.xz |
This will hopefully be the last modification to the resolver code for a while. The complexity comes from the code used only during library build time, to non-threaded programs to threaded programs such that things are not a mess. I was getting undefined '_res' when doing a buildroot, but things are fixed now. This is much cleaner and more sane.
Diffstat (limited to 'include/resolv.h')
-rw-r--r-- | include/resolv.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/resolv.h b/include/resolv.h index 940f1ae0a..1f0aea0be 100644 --- a/include/resolv.h +++ b/include/resolv.h @@ -230,6 +230,12 @@ typedef struct __res_state *res_state; #define RES_PRF_INIT 0x00004000 /* 0x00008000 */ +/* Things involving an internal (static) resolver context. */ +__BEGIN_DECLS +extern struct __res_state *__res_state(void) __attribute__ ((__const__)); +__END_DECLS +#define _res (*__res_state()) + #ifndef __BIND_NOSTATIC #define fp_nquery __fp_nquery @@ -383,11 +389,9 @@ __END_DECLS #endif /* _RESOLV_H_ */ -/* Internal (static) resolver context. */ -#ifdef __PTHREADS_NATIVE__ -#include <tls.h> +#if defined(__PTHREADS_NATIVE__) && defined(IS_IN_libpthread) +# include <tls.h> +# undef _res # define _res (*__resp) extern __thread struct __res_state *__resp attribute_tls_model_ie; -#else -extern struct __res_state _res; #endif |