* allocatestack.c (allocate_stack): Don't demand that there is an
authorUlrich Drepper <drepper@redhat.com>
Tue, 13 Dec 2005 06:16:04 +0000 (06:16 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 13 Dec 2005 06:16:04 +0000 (06:16 +0000)
additional full page available on the stack beside guard, TLS, the
minimum stack.

nptl/ChangeLog
nptl/allocatestack.c

index d30edd2efc6d00cca05917e67028d062c11f1fcf..2b5ae5f56ee37bdf277f5ee7e1b3ad03b9760d65 100644 (file)
@@ -1,3 +1,9 @@
+2005-12-12  Ulrich Drepper  <drepper@redhat.com>
+
+       * 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  <drepper@redhat.com>
 
        * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
index 255129a1df44a16324d15fbedc148db053a4f195..e6bcc2170f7a2c78d69a7444547056728ae4c71c 100644 (file)
@@ -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;