(__pthread_attr_getstack): Return correct address.

This commit is contained in:
Ulrich Drepper 2000-12-27 08:32:00 +00:00
parent 38eb40ea11
commit 5a7d27d4f9

View File

@ -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 /* XXX This function has a stupid definition. The standard specifies
no error value but what is if no stack address was set? We simply no error value but what is if no stack address was set? We simply
return the value we have in the member. */ return the value we have in the member. */
#ifndef _STACK_GROWS_UP
*stackaddr = (char *) attr->__stackaddr - attr->__stacksize;
#else
*stackaddr = attr->__stackaddr; *stackaddr = attr->__stackaddr;
#endif
*stacksize = attr->__stacksize; *stacksize = attr->__stacksize;
return 0; return 0;
} }