about summary refs log tree commit diff
path: root/nptl/pthread_attr_setstack.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_attr_setstack.c')
-rw-r--r--nptl/pthread_attr_setstack.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c
index 19a5b54981..4785501d5d 100644
--- a/nptl/pthread_attr_setstack.c
+++ b/nptl/pthread_attr_setstack.c
@@ -48,7 +48,11 @@ __pthread_attr_setstack (attr, stackaddr, stacksize)
 #endif
 
   iattr->stacksize = stacksize;
+#if _STACK_GROWS_DOWN
   iattr->stackaddr = (char *) stackaddr + stacksize;
+#else
+  iattr->stackaddr = (char *) stackaddr;
+#endif
   iattr->flags |= ATTR_FLAG_STACKADDR;
 
   return 0;
@@ -81,7 +85,11 @@ __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr,
 #  endif
 
   iattr->stacksize = stacksize;
+#if _STACK_GROWS_DOWN
   iattr->stackaddr = (char *) stackaddr + stacksize;
+#else
+  iattr->stackaddr = (char *) stackaddr;
+#endif
   iattr->flags |= ATTR_FLAG_STACKADDR;
 
   return 0;