From db13ddbcfa1e8fb7c58a0022893aef8a8921fd4f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 13 Dec 2005 06:16:04 +0000 Subject: * allocatestack.c (allocate_stack): Don't demand that there is an additional full page available on the stack beside guard, TLS, the minimum stack. --- nptl/ChangeLog | 6 ++++++ nptl/allocatestack.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index d30edd2..2b5ae5f 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,9 @@ +2005-12-12 Ulrich Drepper + + * allocatestack.c (allocate_stack): Don't demand that there is an + additional full page available on the stack beside guard, TLS, the + minimum stack. + 2005-11-24 Ulrich Drepper * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 255129a..e6bcc21 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -407,8 +407,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, /* Make sure the size of the stack is enough for the guard and eventually the thread descriptor. */ guardsize = (attr->guardsize + pagesize_m1) & ~pagesize_m1; - if (__builtin_expect (size < (guardsize + __static_tls_size - + MINIMAL_REST_STACK + pagesize_m1 + 1), + if (__builtin_expect (size < ((guardsize + __static_tls_size + + MINIMAL_REST_STACK + pagesize_m1) + & ~pagesize_m1), 0)) /* The stack is too small (or the guard too large). */ return EINVAL; -- cgit v1.1