diff options
-rw-r--r-- | pthread/pt-create.c | 4 | ||||
-rw-r--r-- | pthread/pt-internal.h | 6 | ||||
-rw-r--r-- | sysdeps/generic/pt-attr-setstacksize.c | 6 |
3 files changed, 2 insertions, 14 deletions
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; } diff --git a/pthread/pt-internal.h b/pthread/pt-internal.h index eca63a1..79db55c 100644 --- a/pthread/pt-internal.h +++ b/pthread/pt-internal.h @@ -94,11 +94,7 @@ struct __pthread /* Thread stack. */ void *stackaddr; size_t stacksize; - size_t guardsize; /* Included in STACKSIZE (i.e. total - stack memory is STACKSIZE, not - STACKSIZE + GUARDSIZE). */ - /* FIXME: standard says that guardsize is in - addition to stacksize. */ + size_t guardsize; int stack; /* Nonzero if the stack was allocated. */ /* Exit status. */ diff --git a/sysdeps/generic/pt-attr-setstacksize.c b/sysdeps/generic/pt-attr-setstacksize.c index c88f917..00d9675 100644 --- a/sysdeps/generic/pt-attr-setstacksize.c +++ b/sysdeps/generic/pt-attr-setstacksize.c @@ -26,11 +26,5 @@ pthread_attr_setstacksize (pthread_attr_t *attr, { attr->stacksize = stacksize; - /* The guard size cannot be larger than the stack itself, as - such, if the new stack size is smaller than the guard size, - we squash the guard size. */ - if (attr->guardsize > attr->stacksize) - attr->guardsize = attr->stacksize; - return 0; } |