diff options
Diffstat (limited to 'pthread')
-rw-r--r-- | pthread/pt-alloc.c | 2 | ||||
-rw-r--r-- | pthread/pt-create.c | 2 | ||||
-rw-r--r-- | pthread/pt-internal.h | 5 |
3 files changed, 9 insertions, 0 deletions
diff --git a/pthread/pt-alloc.c b/pthread/pt-alloc.c index af544c5..4860f48 100644 --- a/pthread/pt-alloc.c +++ b/pthread/pt-alloc.c @@ -68,6 +68,8 @@ initialize_pthread (struct __pthread *new) new->cancelation_handlers = 0; + memset (&new->res_state, '\0', sizeof (new->res_state)); + #ifdef ENABLE_TLS new->tcb = NULL; #endif diff --git a/pthread/pt-create.c b/pthread/pt-create.c index 5358b08..c2c84b1 100644 --- a/pthread/pt-create.c +++ b/pthread/pt-create.c @@ -21,6 +21,7 @@ #include <errno.h> #include <pthread.h> #include <signal.h> +#include <resolv.h> #include <bits/pt-atomic.h> @@ -45,6 +46,7 @@ entry_point (struct __pthread *self, void *(*start_routine)(void *), void *arg) { #ifdef ENABLE_TLS ___pthread_self = self; + __resp = &self->res_state; #endif #ifdef IS_IN_libpthread diff --git a/pthread/pt-internal.h b/pthread/pt-internal.h index 7465761..eca63a1 100644 --- a/pthread/pt-internal.h +++ b/pthread/pt-internal.h @@ -25,6 +25,8 @@ #include <sched.h> #include <signal.h> #include <assert.h> +#define __need_res_state +#include <resolv.h> #include <bits/pt-atomic.h> @@ -107,6 +109,9 @@ struct __pthread pthread_mutex_t state_lock; /* Locks the state. */ pthread_cond_t state_cond; /* Signalled when the state changes. */ + /* Resolver state. */ + struct __res_state res_state; + /* Thread context. */ struct pthread_mcontext mcontext; |