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