pthread_attr_setstacksize(PTHREAD)
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(PTHREAD),
pthread_attr_setstackaddr(PTHREAD),
pthread_attr_setdetachstate(PTHREAD),
pthread_create(PTHREAD),
limits(F),
pthread(F)
Standards compliance
The Single UNIX Specification, Version 2; The Open Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005