diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-05-23 20:45:32 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-05-23 20:45:32 +0200 |
commit | 0660704b3efd251fd737589d0edba13ffebde0c1 (patch) | |
tree | eef0ea2d0a51f39607fedad76d53a333407f6fb2 /pthread/pt-create.c | |
parent | 19657e8b846a7426424f261c355bc54a68b3021b (diff) |
Fix guardsize computation
* pthread/pt-create.c (__pthread_create_internal): Round guardsize up to
page size. Fill `guardsize' field of thread structure.
* sysdeps/mach/hurd/i386/pt-setup.c (stack_setup): Add guardsize to
computation of the top of the stack.
Diffstat (limited to 'pthread/pt-create.c')
-rw-r--r-- | pthread/pt-create.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c index 8c18902..00884b5 100644 --- a/pthread/pt-create.c +++ b/pthread/pt-create.c @@ -118,10 +118,13 @@ __pthread_create_internal (struct __pthread **thread, { /* Allocate a stack. */ err = __pthread_stack_alloc (&pthread->stackaddr, - setup->guardsize + setup->stacksize); + ((setup->guardsize + __vm_page_size-1) + / __vm_page_size) * __vm_page_size + + setup->stacksize); if (err) goto failed_stack_alloc; + pthread->guardsize = setup->guardsize; pthread->stack = 1; } |