pthread_attr_setdefaultguardsize()

QNX SDP8.0C Library ReferenceAPIDeveloper

Set the default stack guard area size

Synopsis:

#include <pthread.h>

int pthread_attr_setdefaultguardsize(size_t const guardsize);
            

Arguments:

guardsize
The new default stack guard area size.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The pthread_attr_setdefaultguardsize() function sets the default stack guard area size for created threads without explicitly overriding this value in the attribute structure. The size specified by this function affects the following:
  1. A pthread_attr_t initialized by pthread_attr_init().
  2. Threads created by pthread_create() with the attr parameter passed as NULL.

The stack guard area is a virtual address space designed to detect stack overruns. Because the stack guard area is not backed by any physical memory, it causes the thread (and hence, the process) to crash when accessing the non-existent memory, rather than corrupting another thread's stack. The default size is 4k (one page).

Returns:

EOK
Success.
EINVAL
The value of guardsize is greater than UINT32_MAX.

Classification:

QNX OS

Safety:
Cancellation pointNo
Signal handlerYes
ThreadYes
Page updated: