pthread_attr_getguardsize_np(3) — Subroutines
NAME
pthread_attr_getguardsize_np − Obtains the guardsize attribute of the specified thread attributes object.
SYNOPSIS
#include <pthread.h>
unsigned long pthread_attr_getguardsize_np(
pthread_attr_t ∗attr );
PARAMETERS
attrThread attributes object whose guardsize attribute is obtained.
DESCRIPTION
This routine obtains the minimum size (in bytes) of the guard area for the stack of a thread that is created using the attributes object specified by the attr argument.
A guard area helps to detect stack overflows by preventing memory access beyond the thread’s stack. Large guard areas are necessary when threads might allocate large structures on the stack.
RETURN VALUES
On successful completion, this routine returns the guardsize attribute value.
If an error condition occurs, this routine returns −1 and sets errno to the corresponding error value. Possible return values are as follows:
| Return | Error | Description |
| guardsize attribute | Successful completion. | |
| −1 | [EINVAL] | The value specified by |
| detachstate is invalid. |
RELATED INFORMATION
pthread_attr_create(3), pthread_attr_setstacksize(3), pthread_create(3)