about summary refs log tree commit diff
path: root/linuxthreads/attr.c
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/attr.c
parent81dacf8ac44e44187fc0b90b75e28b032a8b14ac (diff)
downloadglibc-cc765c2a2e1ab7702080b7fd2f0a7b21d8ac60ff.tar.gz
glibc-cc765c2a2e1ab7702080b7fd2f0a7b21d8ac60ff.tar.xz
glibc-cc765c2a2e1ab7702080b7fd2f0a7b21d8ac60ff.zip
Make _STACK_GROWS_UP work.
Diffstat (limited to 'linuxthreads/attr.c')
-rw-r--r--linuxthreads/attr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/linuxthreads/attr.c b/linuxthreads/attr.c
index 2d06025ba4..eba93f1f67 100644
--- a/linuxthreads/attr.c
+++ b/linuxthreads/attr.c
@@ -283,8 +283,12 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
 
   attr->__inheritsched = descr->p_inheritsched;
   attr->__scope = PTHREAD_SCOPE_SYSTEM;
+#ifdef _STACK_GROWS_DOWN
   attr->__stacksize = (char *)(descr + 1) - (char *)descr->p_guardaddr
 		      - descr->p_guardsize;
+#else
+  attr->__stacksize = (char *)descr->p_guardaddr - (char *)descr;
+#endif
   attr->__guardsize = descr->p_guardsize;
   attr->__stackaddr_set = descr->p_userstack;
 #ifdef NEED_SEPARATE_REGISTER_STACK
@@ -298,7 +302,7 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
 #ifndef _STACK_GROWS_UP
   attr->__stackaddr = (char *)(descr + 1);
 #else
-# error __stackaddr not handled
+  attr->__stackaddr = (char *)descr;
 #endif
 
   return 0;