xref: /openbsd-src/lib/libpthread/man/pthread_attr_setstacksize.3 (revision 47911bd667ac77dc523b8a13ef40b012dbffa741)
1.\" $OpenBSD: pthread_attr_setstacksize.3,v 1.3 2001/06/24 18:17:30 jasoni Exp $
2.\" Manual page derived from TOG's UNIX98 documentation.
3.Dd January 6, 2000
4.Dt PTHREAD_ATTR_SETSTACKSIZE 3
5.Os
6.Sh NAME
7.Nm pthread_attr_setstacksize ,
8.Nm pthread_attr_getstacksize
9.Nd set and get stacksize attribute
10.Sh SYNOPSIS
11.Fd #include <pthread.h>
12.Ft int
13.Fn pthread_attr_setstacksize "pthread_attr_t *attr" "size_t stacksize"
14.Ft int
15.Fn pthread_attr_getstacksize "pthread_attr_t *attr" "size_t *stacksize"
16.Sh DESCRIPTION
17The functions
18.Fn pthread_attr_setstacksize
19and
20.Fn pthread_attr_getstacksize ,
21respectively, set and get the thread
22creation
23.Va stacksize
24attribute in the
25.Fa attr
26object.
27.Pp
28The
29.Va stacksize
30attribute defines the minimum stack size (in bytes)
31allocated for the created thread's stack.
32.Sh RETURN VALUE
33Upon successful completion,
34.Fn pthread_attr_setstacksize
35and
36.Fn pthread_attr_getstacksize
37return a value of 0. Otherwise, an error
38number is returned to indicate the error.
39.Pp
40The
41.Fn pthread_attr_getstacksize
42function stores the
43.Va stacksize
44attribute value in
45.Fa stacksize
46if successful.
47.Sh ERRORS
48The
49.Fn pthread_attr_setstacksize
50function will fail if:
51.Bl -tag -width Er
52.It Bq Er EINVAL
53The value of
54.Fa stacksize
55is less than
56.Dv PTHREAD_STACK_MIN
57or exceeds a system-imposed limit.
58.El
59.Pp
60These functions will not return an error code of
61.Bq Er EINTR .
62.Sh SEE ALSO
63.Xr pthread_attr_init 3 ,
64.Xr pthread_attr_setdetachstate 3 ,
65.Xr pthread_attr_setstackaddr 3 ,
66.Xr pthread_create 3 ,
67.Xr pthreads 3
68.Sh STANDARDS
69.Fn pthread_create
70conforms to ISO/IEC 9945-1 ANSI/IEEE
71.Pq Dq Tn POSIX
72Std 1003.1 Second Edition 1996-07-12.
73