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


pthread_attr_getguardsize_np

Obtains the guardsize attribute of the specified thread attributes object.

Syntax

pthread_attr_getguardsize_np(
                             attr,
                             guardsize );
 


Argument Data Type Access

attr opaque pthread_attr_t read guardsize size_t write


C Binding

#include 

int pthread_attr_getguardsize_np ( const pthread_attr_t *attr size_t *guardsize);

Arguments

attr
Thread attributes object whose guardsize attribute is obtained.
guardsize
Receives the value for the guardsize attribute. The guardsize argument specifies the minimum size (in bytes) of the guard area for a thread.

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

If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Return        Description

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


Associated Routines

   pthread_attr_init
   pthread_attr_setstacksize
   pthread_attr_setguardsize_np
   thread_create



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