1pthread_attr_getstacksize(S3tCa)ndard C Library Functipotnhsread_attr_getstacksize(3C)
2
3
4
6 pthread_attr_getstacksize, pthread_attr_setstacksize - get or set
7 stacksize attribute
8
10 cc -mt [ flag... ] file... -lpthread [ library... ]
11 #include <pthread.h>
12
13 int pthread_attr_getstacksize(const pthread_attr_t *restrict attr,
14 size_t *restrict stacksize);
15
16
17 int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);
18
19
21 The functions pthread_attr_setstacksize() and pthread_attr_getstack‐
22 size(), respectively, set and get the thread creation stacksize
23 attribute in the attr object.
24
25
26 The stacksize attribute defines the minimum stack size (in bytes) allo‐
27 cated for the created threads stack. When the stacksize argument is
28 NULL, the default stack size becomes 1 megabyte for 32-bit processes
29 and 2 megabytes for 64-bit processes.
30
32 Upon successful completion, pthread_attr_setstacksize() and
33 pthread_attr_getstacksize() return a value of 0. Otherwise, an error
34 number is returned to indicate the error. The pthread_attr_getstack‐
35 size() function stores the stacksize attribute value in stacksize if
36 successful.
37
39 The pthread_attr_setstacksize() or pthread_attr_getstacksize() function
40 may fail if:
41
42 EINVAL attr or stacksize is invalid.
43
44
46 See attributes(5) for descriptions of the following attributes:
47
48
49
50
51 ┌─────────────────────────────┬─────────────────────────────┐
52 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
53 ├─────────────────────────────┼─────────────────────────────┤
54 │Interface Stability │Standard │
55 ├─────────────────────────────┼─────────────────────────────┤
56 │MT-Level │MT-Safe │
57 └─────────────────────────────┴─────────────────────────────┘
58
60 pthread_attr_init(3C), pthread_attr_setstackaddr(3C), pthread_attr_set‐
61 detachstate(3C), pthread_create(3C), attributes(5), standards(5)
62
63
64
65SunOS 5.11 23 Mar 2005 pthread_attr_getstacksize(3C)