summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl/pthread_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/pthread_create.c')
-rw-r--r--libpthread/nptl/pthread_create.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpthread/nptl/pthread_create.c b/libpthread/nptl/pthread_create.c
index c83160c80..1dfdb7123 100644
--- a/libpthread/nptl/pthread_create.c
+++ b/libpthread/nptl/pthread_create.c
@@ -26,6 +26,7 @@
#include <ldsodefs.h>
#include <atomic.h>
#include <libc-internal.h>
+#include <resolv.h>
#include <shlib-compat.h>
@@ -266,8 +267,10 @@ start_thread (void *arg)
/* Run the destructor for the thread-local data. */
__nptl_deallocate_tsd ();
+#ifndef __UCLIBC__
/* Clean up any state libc stored in thread-local variables. */
__libc_thread_freeres ();
+#endif
/* If this is the last thread we terminate the process now. We
do not notify the debugger, it might just irritate it if there
@@ -398,6 +401,11 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
pd->schedpolicy = self->schedpolicy;
pd->schedparam = self->schedparam;
+ /* Copy the stack guard canary. */
+#ifdef THREAD_COPY_STACK_GUARD
+ THREAD_COPY_STACK_GUARD (pd);
+#endif
+
/* Determine scheduling parameters for the thread. */
if (attr != NULL
&& __builtin_expect ((iattr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0, 0)