| 1 | --- a/libpthread/nptl/init.c |
| 2 | +++ b/libpthread/nptl/init.c |
| 3 | @@ -402,6 +402,10 @@ __pthread_initialize_minimal_internal (v |
| 4 | Use the minimal size acceptable. */ |
| 5 | limit.rlim_cur = PTHREAD_STACK_MIN; |
| 6 | |
| 7 | + /* Do not exceed architecture specific default */ |
| 8 | + if (limit.rlim_cur > ARCH_STACK_DEFAULT_SIZE) |
| 9 | + limit.rlim_cur = ARCH_STACK_DEFAULT_SIZE; |
| 10 | + |
| 11 | /* Make sure it meets the minimum size that allocate_stack |
| 12 | (allocatestack.c) will demand, which depends on the page size. */ |
| 13 | const uintptr_t pagesz = sysconf (_SC_PAGESIZE); |
| 14 | |