]>
Commit | Line | Data |
---|---|---|
4008a5d5 MK |
1 | .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk |
2 | .\" <mtk.manpages@gmail.com> | |
3 | .\" | |
93015253 | 4 | .\" %%%LICENSE_START(VERBATIM) |
4008a5d5 MK |
5 | .\" Permission is granted to make and distribute verbatim copies of this |
6 | .\" manual provided the copyright notice and this permission notice are | |
7 | .\" preserved on all copies. | |
8 | .\" | |
9 | .\" Permission is granted to copy and distribute modified versions of this | |
10 | .\" manual under the conditions for verbatim copying, provided that the | |
11 | .\" entire resulting derived work is distributed under the terms of a | |
12 | .\" permission notice identical to this one. | |
13 | .\" | |
14 | .\" Since the Linux kernel and libraries are constantly changing, this | |
15 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
16 | .\" responsibility for errors or omissions, or for damages resulting from | |
17 | .\" the use of the information contained herein. The author(s) may not | |
18 | .\" have taken the same level of care in the production of this manual, | |
19 | .\" which is licensed free of charge, as they might when working | |
20 | .\" professionally. | |
21 | .\" | |
22 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
23 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 24 | .\" %%%LICENSE_END |
4008a5d5 | 25 | .\" |
4b8c67d9 | 26 | .TH PTHREAD_ATTR_SETSTACK 3 2017-09-15 "Linux" "Linux Programmer's Manual" |
4008a5d5 MK |
27 | .SH NAME |
28 | pthread_attr_setstack, pthread_attr_getstack \- set/get stack | |
29 | attributes in thread attributes object | |
30 | .SH SYNOPSIS | |
31 | .nf | |
32 | .B #include <pthread.h> | |
dbfe9c70 | 33 | .PP |
4008a5d5 MK |
34 | .BI "int pthread_attr_setstack(pthread_attr_t *" attr , |
35 | .BI " void *" stackaddr ", size_t " stacksize ); | |
e59f5f58 | 36 | .BI "int pthread_attr_getstack(const pthread_attr_t *" attr , |
4008a5d5 | 37 | .BI " void **" stackaddr ", size_t *" stacksize ); |
68e4db0a | 38 | .PP |
4008a5d5 MK |
39 | Compile and link with \fI\-pthread\fP. |
40 | .fi | |
68e4db0a | 41 | .PP |
4008a5d5 MK |
42 | .in -4n |
43 | Feature Test Macro Requirements for glibc (see | |
44 | .BR feature_test_macros (7)): | |
45 | .in | |
68e4db0a | 46 | .PP |
4008a5d5 MK |
47 | .ad l |
48 | .BR pthread_attr_getstack (), | |
49 | .BR pthread_attr_setstack (): | |
13d082ce | 50 | .RS 4 |
a446ac0c | 51 | _POSIX_C_SOURCE\ >=\ 200112L |
13d082ce | 52 | .RE |
4008a5d5 MK |
53 | .ad b |
54 | .SH DESCRIPTION | |
55 | The | |
49c54dd8 | 56 | .BR pthread_attr_setstack () |
e0ea179f | 57 | function sets the stack address and stack size attributes of the |
4008a5d5 MK |
58 | thread attributes object referred to by |
59 | .I attr | |
60 | to the values specified in | |
61 | .IR stackaddr | |
62 | and | |
63 | .IR stacksize , | |
64 | respectively. | |
65 | These attributes specify the location and size of the stack that should | |
66 | be used by a thread that is created using the thread attributes object | |
67 | .IR attr . | |
847e0d88 | 68 | .PP |
4008a5d5 MK |
69 | .I stackaddr |
70 | should point to the lowest addressable byte of a buffer of | |
71 | .I stacksize | |
72 | bytes that was allocated by the caller. | |
73 | The pages of the allocated buffer should be both readable and writable. | |
847e0d88 | 74 | .PP |
4008a5d5 MK |
75 | The |
76 | .BR pthread_attr_getstack () | |
77 | function returns the stack address and stack size attributes of the | |
78 | thread attributes object referred to by | |
79 | .I attr | |
80 | in the buffers pointed to by | |
81 | .IR stackaddr | |
82 | and | |
83 | .IR stacksize , | |
84 | respectively. | |
85 | .SH RETURN VALUE | |
86 | On success, these functions return 0; | |
c7094399 | 87 | on error, they return a nonzero error number. |
4008a5d5 | 88 | .SH ERRORS |