#include <oskit/threads/pthread.h>int pthread_attr_setguardsize(pthread_attr_t *attr, oskit_size_t guardsize);
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.
- attr
- A pointer to the pthread_attr_t object representing the attributes for a thread creation.
- guardsize
- A reasonable stack guard size.
Returns zero on success.
pthread_create, pthread_attr_init, pthread_attr_setstackaddr