From 5a7d27d4f98ff74f5b2ad4108d9092c3aaae6aa4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 27 Dec 2000 08:32:00 +0000 Subject: [PATCH] (__pthread_attr_getstack): Return correct address. --- linuxthreads/attr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linuxthreads/attr.c b/linuxthreads/attr.c index 9f7a191..580da03 100644 --- a/linuxthreads/attr.c +++ b/linuxthreads/attr.c @@ -258,7 +258,11 @@ int __pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr, /* XXX This function has a stupid definition. The standard specifies no error value but what is if no stack address was set? We simply return the value we have in the member. */ +#ifndef _STACK_GROWS_UP + *stackaddr = (char *) attr->__stackaddr - attr->__stacksize; +#else *stackaddr = attr->__stackaddr; +#endif *stacksize = attr->__stacksize; return 0; } -- 2.7.4