]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
e5b89a8d MK |
2 | .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk |
3 | .\" <mtk.manpages@gmail.com> | |
4 | .\" | |
5fbde956 | 5 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
e5b89a8d | 6 | .\" |
4c1c5274 | 7 | .TH pthread_attr_setstackaddr 3 (date) "Linux man-pages (unreleased)" |
e5b89a8d MK |
8 | .SH NAME |
9 | pthread_attr_setstackaddr, pthread_attr_getstackaddr \- | |
10 | set/get stack address attribute in thread attributes object | |
d8f2ce5c AC |
11 | .SH LIBRARY |
12 | POSIX threads library | |
8fc3b2cf | 13 | .RI ( libpthread ", " \-lpthread ) |
e5b89a8d MK |
14 | .SH SYNOPSIS |
15 | .nf | |
16 | .B #include <pthread.h> | |
dbfe9c70 | 17 | .PP |
4131356c | 18 | .B [[deprecated]] |
e5b89a8d MK |
19 | .BI "int pthread_attr_setstackaddr(pthread_attr_t *" attr \ |
20 | ", void *" stackaddr ); | |
4131356c | 21 | .B [[deprecated]] |
4517c06e AC |
22 | .BI "int pthread_attr_getstackaddr(const pthread_attr_t *restrict " attr , |
23 | .BI " void **restrict " stackaddr ); | |
6030f2d8 | 24 | .fi |
e5b89a8d | 25 | .SH DESCRIPTION |
c5571b61 | 26 | These functions are obsolete: |
e5b89a8d MK |
27 | .B do not use them. |
28 | Use | |
29 | .BR pthread_attr_setstack (3) | |
30 | and | |
31 | .BR pthread_attr_getstack (3) | |
32 | instead. | |
847e0d88 | 33 | .PP |
e5b89a8d MK |
34 | The |
35 | .BR pthread_attr_setstackaddr () | |
36 | function sets the stack address attribute of the | |
37 | thread attributes object referred to by | |
38 | .I attr | |
39 | to the value specified in | |
40 | .IR stackaddr . | |
41 | This attribute specifies the location of the stack that should | |
42 | be used by a thread that is created using the thread attributes object | |
43 | .IR attr . | |
847e0d88 | 44 | .PP |
e5b89a8d MK |
45 | .I stackaddr |
46 | should point to a buffer of at least | |
47 | .B PTHREAD_STACK_MIN | |
48 | bytes that was allocated by the caller. | |
49 | The pages of the allocated buffer should be both readable and writable. | |
847e0d88 | 50 | .PP |
e5b89a8d MK |
51 | The |
52 | .BR pthread_attr_getstackaddr () | |
53 | function returns the stack address attribute of the | |
54 | thread attributes object referred to by | |
55 | .I attr | |
56 | in the buffer pointed to by | |
57 | .IR stackaddr . | |
58 | .SH RETURN VALUE | |
59 | On success, these functions return 0; | |
c7094399 | 60 | on error, they return a nonzero error number. |
e5b89a8d MK |
61 | .SH ERRORS |
62 | No errors are defined | |
63 | (but applications should nevertheless | |
64 | handle a possible error return). | |
655d3998 | 65 | .SH ATTRIBUTES |
b11d75e3 PH |
66 | For an explanation of the terms used in this section, see |
67 | .BR attributes (7). | |
68 | .TS | |
69 | allbox; | |
c466875e | 70 | lbx lb lb |
b11d75e3 PH |
71 | l l l. |
72 | Interface Attribute Value | |
73 | T{ | |
9e54434e BR |
74 | .na |
75 | .nh | |
b11d75e3 | 76 | .BR pthread_attr_setstackaddr (), |
655d3998 | 77 | .BR pthread_attr_getstackaddr () |
b11d75e3 PH |
78 | T} Thread safety MT-Safe |
79 | .TE | |
c466875e | 80 | .sp 1 |
3113c7f3 | 81 | .SH STANDARDS |
4131356c AC |
82 | None. |
83 | .SH HISTORY | |
84 | glibc 2.1. | |
85 | Marked obsolete in POSIX.1-2001. | |
86 | Removed in POSIX.1-2008. | |
e5b89a8d MK |
87 | .SH NOTES |
88 | .I Do not use these functions! | |
89 | They cannot be portably used, since they provide no way of specifying | |
90 | the direction of growth or the range of the stack. | |
5fab2e7c | 91 | For example, on architectures with a stack that grows downward, |
e5b89a8d MK |
92 | .I stackaddr |
93 | specifies the next address past the | |
94 | .I highest | |
95 | address of the allocated stack area. | |
5fab2e7c | 96 | However, on architectures with a stack that grows upward, |
e5b89a8d MK |
97 | .I stackaddr |
98 | specifies the | |
99 | .I lowest | |
100 | address in the allocated stack area. | |
101 | By contrast, the | |
102 | .I stackaddr | |
103 | used by | |
104 | .BR pthread_attr_setstack (3) | |
105 | and | |
106 | .BR pthread_attr_getstack (3), | |
107 | is always a pointer to the lowest address in the allocated stack area | |
108 | (and the | |
109 | .I stacksize | |
110 | argument specifies the range of the stack). | |
111 | .SH SEE ALSO | |
112 | .BR pthread_attr_init (3), | |
113 | .BR pthread_attr_setstack (3), | |
114 | .BR pthread_attr_setstacksize (3), | |
115 | .BR pthread_create (3), | |
116 | .BR pthreads (7) |