diff options
-rw-r--r-- | pthread/pt-create.c | 5 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/pt-setup.c | 4 |
2 files changed, 7 insertions, 2 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; } diff --git a/sysdeps/mach/hurd/i386/pt-setup.c b/sysdeps/mach/hurd/i386/pt-setup.c index c3abe91..4511463 100644 --- a/sysdeps/mach/hurd/i386/pt-setup.c +++ b/sysdeps/mach/hurd/i386/pt-setup.c @@ -46,7 +46,9 @@ stack_setup (struct __pthread *thread, /* Calculate the top of the new stack. */ bottom = thread->stackaddr; - top = (uintptr_t *) ((uintptr_t) bottom + thread->stacksize); + top = (uintptr_t *) ((uintptr_t) bottom + thread->stacksize + + ((thread->guardsize + __vm_page_size-1) + / __vm_page_size) * __vm_page_size); if (start_routine) { |