about summary refs log tree commit diff
path: root/resolv
diff options
context:
space:
mode:
Diffstat (limited to 'resolv')
-rw-r--r--resolv/netdb.h11
-rw-r--r--resolv/res_query.c2
2 files changed, 12 insertions, 1 deletions
diff --git a/resolv/netdb.h b/resolv/netdb.h
index cca3060826..1269443cb9 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -43,6 +43,17 @@ __BEGIN_DECLS
 /* Error status for non-reentrant lookup functions.  */
 extern int h_errno;
 
+#if defined __USE_REENTRANT && (!defined _LIBC || defined _LIBC_REENTRANT)
+/* Function to access thread specific `h_errno' variable.  */
+extern int *__h_errno_location __P ((void)) __attribute__ ((__const__));
+
+/* An alias name for above variable.  */
+extern int __h_errno;
+
+/* Use a macro to access always the thread specific `h_errno' variable.  */
+#define h_errno (*__h_errno_location ())
+#endif
+
 /* Possible values left in `h_errno'.  */
 #define	NETDB_INTERNAL	-1	/* See errno.  */
 #define	NETDB_SUCCESS	0	/* No problem.  */
diff --git a/resolv/res_query.c b/resolv/res_query.c
index 7ee6be7663..135c6aa5c0 100644
--- a/resolv/res_query.c
+++ b/resolv/res_query.c
@@ -87,7 +87,7 @@ static char rcsid[] = "$Id$";
 #endif
 
 char *__hostalias __P((const char *));
-int h_errno;
+
 
 /*
  * Formulate a normal query, send, and await answer.