Multithreaded Programming Guide

Get Stack Size

pthread_attr_getstacksize(3THR)

pthread_attr_getstacksize(3THR) returns the stack size set by pthread_attr_setstacksize().

Prototype:

int	pthread_attr_getstacksize(pthread_attr_t *tattr, size_t *size);
#include <pthread.h>

pthread_attr_t tattr;
size_t size;
int ret;

/* getting the stack size */
ret = pthread_attr_getstacksize(&tattr, &size);

Return Values

pthread_attr_getstacksize() returns zero after completing successfully. Any other return value indicates that an error occurred. If the following condition occurs, the function fails and returns the corresponding value.


EINVAL

tattr is not valid.