summaryrefslogtreecommitdiff
path: root/linuxthreads/internals.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-06-16 18:47:49 +0000
committerUlrich Drepper <drepper@redhat.com>2001-06-16 18:47:49 +0000
commitcc765c2a2e1ab7702080b7fd2f0a7b21d8ac60ff (patch)
tree6f8ce94483cd5a47aebac0c6ced2904ea9670d42 /linuxthreads/internals.h
parent81dacf8ac44e44187fc0b90b75e28b032a8b14ac (diff)
Make _STACK_GROWS_UP work.
Diffstat (limited to 'linuxthreads/internals.h')
-rw-r--r--linuxthreads/internals.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h
index aeb45aae01..a78f9b671b 100644
--- a/linuxthreads/internals.h
+++ b/linuxthreads/internals.h
@@ -384,7 +384,11 @@ static inline pthread_descr thread_self (void)
else if (__pthread_nonstandard_stacks)
return __pthread_find_self();
else
+#ifdef _STACK_GROWS_DOWN
return (pthread_descr)(((unsigned long)sp | (STACK_SIZE-1))+1) - 1;
+#else
+ return (pthread_descr)((unsigned long)sp &~ (STACK_SIZE-1));
+#endif
#endif
}