summaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc/patches-0.9.33.2/190-nptl_use_arch_default_stack_limit.patch
blob: b7f5c82e0576cdb343099e8fc1a12d040e5878d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -402,6 +402,10 @@ __pthread_initialize_minimal_internal (v
        Use the minimal size acceptable.  */
     limit.rlim_cur = PTHREAD_STACK_MIN;
 
+  /* Do not exceed architecture specific default */
+  if (limit.rlim_cur > ARCH_STACK_DEFAULT_SIZE)
+    limit.rlim_cur = ARCH_STACK_DEFAULT_SIZE;
+
   /* 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);