summary refs log tree commit diff
path: root/linuxthreads/attr.c
diff options
context:
space:
mode:
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;
 }