summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/pthread.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-09-25 12:23:21 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-09-25 12:23:21 +0000
commitda196a90067a621d41b8a02a0606ee402573a73c (patch)
treefe3c895c59747f64314997124c6e95c8f1d3e3d7 /libpthread/linuxthreads/pthread.c
parent9f8088b0807e584ba5f00e034213fb5696b3e85f (diff)
- if we only have socket support then there is no resolver state:
In function `__pthread_reset_main_thread': undefined reference to `_res'
Diffstat (limited to 'libpthread/linuxthreads/pthread.c')
-rw-r--r--libpthread/linuxthreads/pthread.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index 4c44252ab..4c123dea8 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -45,11 +45,12 @@ extern __typeof(sigaction) __libc_sigaction;
extern int _errno;
extern int _h_errno;
+# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
/* We need the global/static resolver state here. */
# include <resolv.h>
# undef _res
-
extern struct __res_state _res;
+# endif
#endif
#ifdef USE_TLS
@@ -72,7 +73,9 @@ struct _pthread_descr_struct __pthread_initial_thread = {
#if !(USE_TLS && HAVE___THREAD)
.p_errnop = &_errno,
.p_h_errnop = &_h_errno,
+# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
.p_resp = &_res,
+# endif
#endif
.p_userstack = 1,
.p_resume_count = __ATOMIC_INITIALIZER,
@@ -539,15 +542,17 @@ static void pthread_initialize(void)
#ifdef USE_TLS
/* Update the descriptor for the initial thread. */
THREAD_SETMEM (((pthread_descr) NULL), p_pid, __getpid());
-# ifndef HAVE___THREAD
+# if !defined HAVE___THREAD && (defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__)
/* Likewise for the resolver state _res. */
THREAD_SETMEM (((pthread_descr) NULL), p_resp, &_res);
# endif
#else
/* Update the descriptor for the initial thread. */
__pthread_initial_thread.p_pid = __getpid();
+# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
/* Likewise for the resolver state _res. */
__pthread_initial_thread.p_resp = &_res;
+# endif
#endif
#if !__ASSUME_REALTIME_SIGNALS
/* Initialize real-time signals. */
@@ -1112,7 +1117,9 @@ void __pthread_reset_main_thread(void)
/* Now this thread modifies the global variables. */
THREAD_SETMEM(self, p_errnop, &_errno);
THREAD_SETMEM(self, p_h_errnop, &_h_errno);
+# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
THREAD_SETMEM(self, p_resp, &_res);
+# endif
#endif
#ifndef FLOATING_STACKS