1PTHREAD_ATTR_GETSTACKSIZE(3PP)OSIX Programmer's ManuPaTlHREAD_ATTR_GETSTACKSIZE(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 pthread_attr_getstacksize, pthread_attr_setstacksize — get and set the
13 stacksize attribute
14
16 #include <pthread.h>
17
18 int pthread_attr_getstacksize(const pthread_attr_t *restrict attr,
19 size_t *restrict stacksize);
20 int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);
21
23 The pthread_attr_getstacksize() and pthread_attr_setstacksize() func‐
24 tions, respectively, shall get and set the thread creation stacksize
25 attribute in the attr object.
26
27 The stacksize attribute shall define the minimum stack size (in bytes)
28 allocated for the created threads stack.
29
30 The behavior is undefined if the value specified by the attr argument
31 to pthread_attr_getstacksize() or pthread_attr_setstacksize() does not
32 refer to an initialized thread attributes object.
33
35 Upon successful completion, pthread_attr_getstacksize() and
36 pthread_attr_setstacksize() shall return a value of 0; otherwise, an
37 error number shall be returned to indicate the error.
38
39 The pthread_attr_getstacksize() function stores the stacksize attribute
40 value in stacksize if successful.
41
43 The pthread_attr_setstacksize() function shall fail if:
44
45 EINVAL The value of stacksize is less than {PTHREAD_STACK_MIN} or
46 exceeds a system-imposed limit.
47
48 These functions shall not return an error code of [EINTR].
49
50 The following sections are informative.
51
53 None.
54
56 None.
57
59 If an implementation detects that the value specified by the attr argu‐
60 ment to pthread_attr_getstacksize() or pthread_attr_setstacksize() does
61 not refer to an initialized thread attributes object, it is recommended
62 that the function should fail and report an [EINVAL] error.
63
65 None.
66
68 pthread_attr_destroy(), pthread_attr_getdetachstate(), pthread_create()
69
70 The Base Definitions volume of POSIX.1‐2017, <limits.h>, <pthread.h>
71
73 Portions of this text are reprinted and reproduced in electronic form
74 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
75 table Operating System Interface (POSIX), The Open Group Base Specifi‐
76 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
77 Electrical and Electronics Engineers, Inc and The Open Group. In the
78 event of any discrepancy between this version and the original IEEE and
79 The Open Group Standard, the original IEEE and The Open Group Standard
80 is the referee document. The original Standard can be obtained online
81 at http://www.opengroup.org/unix/online.html .
82
83 Any typographical or formatting errors that appear in this page are
84 most likely to have been introduced during the conversion of the source
85 files to man page format. To report such errors, see https://www.ker‐
86 nel.org/doc/man-pages/reporting_bugs.html .
87
88
89
90IEEE/The Open Group 2017 PTHREAD_ATTR_GETSTACKSIZE(3P)