Make nptl/res.c work when __thread is not supported
authorDavid Bartley <dtbartle@csclub.uwaterloo.ca>
Thu, 14 Aug 2008 00:44:04 +0000 (20:44 -0400)
committerDavid Bartley <dtbartle@csclub.uwaterloo.ca>
Thu, 14 Aug 2008 00:49:52 +0000 (20:49 -0400)
nptl/res.c

index ba4f81d..28c5975 100644 (file)
 #include <resolv.h>
 #include <tls.h>
 
+#if ! USE___THREAD
+
+# undef _res
+extern struct __res_state _res;
+
+/* When threaded, _res may be a per-thread variable.  */
+struct __res_state *
+weak_const_function
+__res_state (void)
+{
+  return &_res;
+}
+
+#else
+
 struct __res_state *
 __res_state (void)
 {
   return __resp;
 }
+
+#endif