summaryrefslogblamecommitdiff
path: root/src/thread/pthread_attr_getstack.c
blob: 70adbb03a32bd40333c196c80a25b3e7dd5c8636 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                         
                                                                                                        






                                                     
#include "pthread_impl.h"

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