From 19657e8b846a7426424f261c355bc54a68b3021b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 2 May 2014 12:30:16 +0200 Subject: Fix guardsize semantic POSIX says guardsize is in addition to stacksize, not included. * pthread/pt-create.c (__pthread_create_internal): Use setup->guardsize + setup->stacksize as stack allocation size. Do not truncate guardsize to stacksize. * pthread/pt-internal.h (guardsize): Remove comment. * sysdeps/generic/pt-attr-setstacksize.c (pthread_attr_setstacksize): Do not truncate guardsize to stacksize. --- pthread/pt-create.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pthread/pt-create.c') diff --git a/pthread/pt-create.c b/pthread/pt-create.c index c2c84b1..8c18902 100644 --- a/pthread/pt-create.c +++ b/pthread/pt-create.c @@ -118,12 +118,10 @@ __pthread_create_internal (struct __pthread **thread, { /* Allocate a stack. */ err = __pthread_stack_alloc (&pthread->stackaddr, - setup->stacksize); + setup->guardsize + setup->stacksize); if (err) goto failed_stack_alloc; - pthread->guardsize = (setup->guardsize <= setup->stacksize - ? setup->guardsize : setup->stacksize); pthread->stack = 1; } -- cgit v1.2.3