[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


pthread_attr_setguardsize_np

Changes the guardsize attribute of thread creation.

Syntax

pthread_attr_setguardsize_np(
                             attr,
                             guardsize );
 


Argument Data Type Access

attr opaque pthread_attr_t read guardsize longword read


C Binding

int
pthread_attr_setguardsize_np (
pthread_attr_t *attr,
long guardsize);

Arguments

attr
Threads attributes object modified.
guardsize
New value for the guardsize attribute. The guardsize argument specifies the minimum size (in bytes) of the guard area for the stack of a thread.

Description

This routine sets 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

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

0 Successful completion. -1 [EINVAL] The value specified by attr is invalid.



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]