summaryrefslogtreecommitdiff
path: root/src/thread/pthread_attr_getstack.c
blob: 07ac5926c0bee747ebc27beff65d238e04b356ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#include "pthread_impl.h"

int pthread_attr_getstack(const pthread_attr_t *a, void **addr, size_t *size)
{
	if (!a->_a_stackaddr)
		return EINVAL;
	*size = a->_a_stacksize + DEFAULT_STACK_SIZE;
	*addr = (void *)(a->_a_stackaddr - *size);
	return 0;
}