next up previous contents index
Next: 18.3.8 pthread_attr_setstacksize: Set the Up: 18.3 POSIX Threads Reference Previous: 18.3.6 pthread_attr_setstackaddr: Set the

18.3.7 pthread_attr_setguardsize: Set the stack guard size in a thread attributes object

 

SYNOPSIS

#include <oskit/threads/pthread.h>

int pthread_attr_setguardsize(pthread_attr_t *attr, oskit_size_t guardsize);

DESCRIPTION

Set the stack guard size in a previously initialized threads attribute object, for use with pthread_create. This much extra space will be allocated at the end of the stack and set as a redzone to catch stack overflow. The guard size is rounded up to a multiple of the native page size. Stack guards are not created for stacks provided with pthread_attr_setstackaddr.

PARAMETERS

attr
A pointer to the pthread_attr_t object representing the attributes for a thread creation.
guardsize
A reasonable stack guard size.

RETURNS

Returns zero on success.

RELATED INFORMATION

pthread_create, pthread_attr_init, pthread_attr_setstackaddr



University of Utah Flux Research Group