[Previous] [Contents] [Next]

pthread_attr_setstacksize()

Set thread stack size attribute

Synopsis:

#include <pthread.h>

int pthread_attr_setstacksize( pthread_attr_t * attr,
                               size_t stacksize );

Library:

libc

Description:

The pthread_attr_setstacksize() function sets the thread stack size attribute in the thread attribute object attr to stacksize. The default and minimum value of the thread stack size attribute is PTHREAD_STACK_MIN.

Returns:

EOK
Success.
EINVAL
The value of stacksize is less than PTHREAD_STACK_MIN or greater than the system limit.

Classification:

POSIX 1003.1 (Threads)

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

The QNX interpretation of PTHREAD_STACK_MIN is enough memory to run a thread that does nothing:

void nothingthread( void )
{
    return;
}

See also:

pthread_attr_getstacksize(), pthread_attr_init(), pthread_create().


[Previous] [Contents] [Next]