#include <errno.h>
#include <netdb.h>
+#include <resolv.h>
+#include <tls.h>
#include "pthread.h"
#include "internals.h"
-int * __errno_location()
+#if !USE_TLS || !HAVE___THREAD
+/* The definition in libc is sufficient if we use TLS. */
+int *
+__errno_location (void)
{
pthread_descr self = thread_self();
return THREAD_GETMEM (self, p_errnop);
}
-int * __h_errno_location()
+int *
+__h_errno_location (void)
{
pthread_descr self = thread_self();
return THREAD_GETMEM (self, p_h_errnop);
}
+
+/* Return thread specific resolver state. */
+struct __res_state *
+__res_state (void)
+{
+ pthread_descr self = thread_self();
+ return THREAD_GETMEM (self, p_resp);
+}
+#endif