From cc765c2a2e1ab7702080b7fd2f0a7b21d8ac60ff Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 16 Jun 2001 18:47:49 +0000 Subject: Make _STACK_GROWS_UP work. --- linuxthreads/internals.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linuxthreads/internals.h') diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h index aeb45aa..a78f9b6 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 } -- cgit v1.1