pthread_attr_setstacksize(3pthread)


pthread_attr_setstacksize, pthread_attr_getstacksize -- set and get stacksize attribute

Synopsis

cc [options] -Kthread file

#include <pthread.h>

int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize);

Description

pthread_attr_setstacksize and pthread_attr_getstacksize respectively, set and get the thread creation stacksize attribute in the attr object.

The stacksize attribute defines the minimum stack size (in bytes) allocated for the created threads stack.

Return values

Upon successful completion, pthread_attr_setstacksize and pthread_attr_getstacksize return a value of 0. Otherwise, an error number is returned to indicate the error. The pthread_attr_getstacksize function stores the stacksize attribute value in stacksize if successful.

Diagnostics

If the following condition is detected, pthread_attr_setstacksize will return the corresponding value:

EINVAL
stacksize is less than PTHREAD_STACK_MIN or exceeds a system-imposed limit.
If the following condition is detected, pthread_attr_setstacksize and pthread_attr_getstacksize will return the corresponding value:

EINVAL
invalid attr argument

References

pthread_attr_init(3pthread), pthread_attr_setstackaddr(3pthread), pthread_attr_setdetachstate(3pthread), pthread_create(3pthread), limits(4), pthread(4)

Standards compliance

The Single UNIX Specification, Version 2; The Open Group.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004