|
@@ -445,7 +445,7 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
|
|
|
new_thread = ((pthread_descr) (new_thread_bottom + stacksize
|
|
|
+ guardsize)) - 1;
|
|
|
# endif
|
|
|
-# elif _STACK_GROWS_DOWN
|
|
|
+# elif defined _STACK_GROWS_DOWN
|
|
|
guardaddr = map_addr;
|
|
|
if (guardsize > 0)
|
|
|
mprotect (guardaddr, guardsize, PROT_NONE);
|
|
@@ -456,7 +456,7 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
|
|
|
# else
|
|
|
new_thread = ((pthread_descr) (new_thread_bottom + stacksize)) - 1;
|
|
|
# endif
|
|
|
-# elif _STACK_GROWS_UP
|
|
|
+# elif defined _STACK_GROWS_UP
|
|
|
guardaddr = map_addr + stacksize;
|
|
|
if (guardsize > 0)
|
|
|
mprotect (guardaddr, guardsize, PROT_NONE);
|
|
@@ -744,7 +744,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
|
|
|
(char *)stack_addr - new_thread_bottom,
|
|
|
CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
|
|
|
__pthread_sig_cancel, new_thread);
|
|
|
-#elif _STACK_GROWS_UP
|
|
|
+#elif defined _STACK_GROWS_UP
|
|
|
pid = __clone(pthread_start_thread_event, (void *) new_thread_bottom,
|
|
|
CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
|
|
|
__pthread_sig_cancel, new_thread);
|
|
@@ -785,7 +785,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
|
|
|
(char *)stack_addr - new_thread_bottom,
|
|
|
CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
|
|
|
__pthread_sig_cancel, new_thread);
|
|
|
-#elif _STACK_GROWS_UP
|
|
|
+#elif defined _STACK_GROWS_UP
|
|
|
pid = __clone(pthread_start_thread, (void *) new_thread_bottom,
|
|
|
CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
|
|
|
__pthread_sig_cancel, new_thread);
|
|
@@ -806,7 +806,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
|
|
|
- new_thread_bottom);
|
|
|
munmap((caddr_t)new_thread_bottom,
|
|
|
2 * stacksize + new_thread->p_guardsize);
|
|
|
-#elif _STACK_GROWS_UP
|
|
|
+#elif defined _STACK_GROWS_UP
|
|
|
# ifdef USE_TLS
|
|
|
size_t stacksize = guardaddr - stack_addr;
|
|
|
munmap(stack_addr, stacksize + guardsize);
|