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