Set the thread stack-size attribute
#include <pthread.h> int pthread_attr_setstacksize( pthread_attr_t * attr, size_t stacksize );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The pthread_attr_setstacksize() function sets the thread stack size attribute in the thread attribute object attr to stacksize.
The system uses some of the provided stack for objects such as thread local storage and an initial stack frame, so less than the entire buffer is available to the thread. |
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
The QNX interpretation of PTHREAD_STACK_MIN is enough memory to run a thread that does nothing:
void nothingthread( void ) { return; }
pthread_attr_getstacksize(), pthread_attr_init(), pthread_create().
Processes and Threads chapter of Getting Started with QNX Neutrino