summary refs log tree commit diff
path: root/nptl/nptl-init.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-12-22 22:43:39 -0500
committerUlrich Drepper <drepper@gmail.com>2011-12-22 22:43:39 -0500
commit2c1094bd700e63a8d7f547b3f5495bedb55c0a08 (patch)
treebf579617e656820ae621652a6fa5219cdfc897d3 /nptl/nptl-init.c
parent3b8dfc621bfd320c924a3cd597086d3473da1cf4 (diff)
downloadglibc-2c1094bd700e63a8d7f547b3f5495bedb55c0a08.tar.gz
glibc-2c1094bd700e63a8d7f547b3f5495bedb55c0a08.tar.xz
glibc-2c1094bd700e63a8d7f547b3f5495bedb55c0a08.zip
Create internal threads with sufficient stack size
Diffstat (limited to 'nptl/nptl-init.c')
-rw-r--r--nptl/nptl-init.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index db45cab230..4349224463 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -427,7 +427,7 @@ __pthread_initialize_minimal_internal (void)
 
   /* Make sure it meets the minimum size that allocate_stack
      (allocatestack.c) will demand, which depends on the page size.  */
-  const uintptr_t pagesz = __sysconf (_SC_PAGESIZE);
+  const uintptr_t pagesz = GLRO(dl_pagesize);
   const size_t minstack = pagesz + __static_tls_size + MINIMAL_REST_STACK;
   if (limit.rlim_cur < minstack)
     limit.rlim_cur = minstack;
@@ -469,3 +469,13 @@ __pthread_initialize_minimal_internal (void)
 }
 strong_alias (__pthread_initialize_minimal_internal,
 	      __pthread_initialize_minimal)
+
+
+size_t
+__pthread_get_minstack (const pthread_attr_t *attr)
+{
+  struct pthread_attr *iattr = (struct pthread_attr *) attr;
+
+  return (GLRO(dl_pagesize) + __static_tls_size + PTHREAD_STACK_MIN
+	  + iattr->guardsize);
+}