1PTHREAD_ATTR_GETSTACKSIZE(3PP)OSIX Programmer's ManuPaTlHREAD_ATTR_GETSTACKSIZE(3P)
2
3
4

PROLOG

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
11

NAME

13       pthread_attr_getstacksize, pthread_attr_setstacksize — get and set the
14       stacksize attribute
15

SYNOPSIS

17       #include <pthread.h>
18
19       int pthread_attr_getstacksize(const pthread_attr_t *restrict attr,
20           size_t *restrict stacksize);
21       int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);
22

DESCRIPTION

24       The  pthread_attr_getstacksize()  and pthread_attr_setstacksize() func‐
25       tions, respectively, shall get and set the  thread  creation  stacksize
26       attribute in the attr object.
27
28       The  stacksize attribute shall define the minimum stack size (in bytes)
29       allocated for the created threads stack.
30
31       The behavior is undefined if the value specified by the  attr  argument
32       to  pthread_attr_getstacksize() or pthread_attr_setstacksize() does not
33       refer to an initialized thread attributes object.
34

RETURN VALUE

36       Upon    successful    completion,    pthread_attr_getstacksize()    and
37       pthread_attr_setstacksize()  shall  return  a value of 0; otherwise, an
38       error number shall be returned to indicate the error.
39
40       The pthread_attr_getstacksize() function stores the stacksize attribute
41       value in stacksize if successful.
42

ERRORS

44       The pthread_attr_setstacksize() function shall fail if:
45
46       EINVAL The  value  of  stacksize  is  less  than {PTHREAD_STACK_MIN} or
47              exceeds a system-imposed limit.
48
49       These functions shall not return an error code of [EINTR].
50
51       The following sections are informative.
52

EXAMPLES

54       None.
55

APPLICATION USAGE

57       None.
58

RATIONALE

60       If an implementation detects that the value specified by the attr argu‐
61       ment to pthread_attr_getstacksize() or pthread_attr_setstacksize() does
62       not refer to an initialized thread attributes object, it is recommended
63       that the function should fail and report an [EINVAL] error.
64

FUTURE DIRECTIONS

66       None.
67

SEE ALSO

69       pthread_attr_destroy(), pthread_attr_getdetachstate(), pthread_create()
70
71       The Base Definitions volume of POSIX.1‐2008, <limits.h>, <pthread.h>
72
74       Portions  of  this text are reprinted and reproduced in electronic form
75       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
76       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
77       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
78       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
79       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
80       event of any discrepancy between this version and the original IEEE and
81       The Open Group Standard, the original IEEE and The Open Group  Standard
82       is  the  referee document. The original Standard can be obtained online
83       at http://www.unix.org/online.html .
84
85       Any typographical or formatting errors that appear  in  this  page  are
86       most likely to have been introduced during the conversion of the source
87       files to man page format. To report such errors,  see  https://www.ker
88       nel.org/doc/man-pages/reporting_bugs.html .
89
90
91
92IEEE/The Open Group                  2013        PTHREAD_ATTR_GETSTACKSIZE(3P)
Impressum