summaryrefslogtreecommitdiff
path: root/linuxthreads/attr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-12-27 08:32:00 +0000
committerUlrich Drepper <drepper@redhat.com>2000-12-27 08:32:00 +0000
commit5a7d27d4f98ff74f5b2ad4108d9092c3aaae6aa4 (patch)
tree2e685a3dd8afa784c062122f62988ccc7b228357 /linuxthreads/attr.c
parent38eb40ea11b26e12c1118ccd9d18889fc310c1fc (diff)
(__pthread_attr_getstack): Return correct address.
Diffstat (limited to 'linuxthreads/attr.c')
-rw-r--r--linuxthreads/attr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linuxthreads/attr.c b/linuxthreads/attr.c
index 9f7a191ec6..580da03b40 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;
}