summaryrefslogtreecommitdiff
path: root/linuxthreads/manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads/manager.c')
-rw-r--r--linuxthreads/manager.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index f8647b47ca..462ce4a0d4 100644
--- a/linuxthreads/manager.c
+++ b/linuxthreads/manager.c
@@ -70,8 +70,13 @@ static pthread_descr manager_thread;
#else
static inline pthread_descr thread_segment(int seg)
{
+# ifdef _STACK_GROWS_UP
+ return (pthread_descr)(THREAD_STACK_START_ADDRESS + (seg - 1) * STACK_SIZE)
+ + 1;
+# else
return (pthread_descr)(THREAD_STACK_START_ADDRESS - (seg - 1) * STACK_SIZE)
- 1;
+# endif
}
#endif