]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/pthread_attr_setstackaddr.3
e92e442db3b689f3462c3c7f8a05f76b71b6514f
[thirdparty/man-pages.git] / man3 / pthread_attr_setstackaddr.3
1 '\" t
2 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH pthread_attr_setstackaddr 3 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 pthread_attr_setstackaddr, pthread_attr_getstackaddr \-
10 set/get stack address attribute in thread attributes object
11 .SH LIBRARY
12 POSIX threads library
13 .RI ( libpthread ", " \-lpthread )
14 .SH SYNOPSIS
15 .nf
16 .B #include <pthread.h>
17 .PP
18 .B [[deprecated]]
19 .BI "int pthread_attr_setstackaddr(pthread_attr_t *" attr \
20 ", void *" stackaddr );
21 .B [[deprecated]]
22 .BI "int pthread_attr_getstackaddr(const pthread_attr_t *restrict " attr ,
23 .BI " void **restrict " stackaddr );
24 .fi
25 .SH DESCRIPTION
26 These functions are obsolete:
27 .B do not use them.
28 Use
29 .BR pthread_attr_setstack (3)
30 and
31 .BR pthread_attr_getstack (3)
32 instead.
33 .PP
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 .
44 .PP
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.
50 .PP
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;
60 on error, they return a nonzero error number.
61 .SH ERRORS
62 No errors are defined
63 (but applications should nevertheless
64 handle a possible error return).
65 .SH ATTRIBUTES
66 For an explanation of the terms used in this section, see
67 .BR attributes (7).
68 .ad l
69 .nh
70 .TS
71 allbox;
72 lbx lb lb
73 l l l.
74 Interface Attribute Value
75 T{
76 .BR pthread_attr_setstackaddr (),
77 .BR pthread_attr_getstackaddr ()
78 T} Thread safety MT-Safe
79 .TE
80 .hy
81 .ad
82 .sp 1
83 .SH STANDARDS
84 None.
85 .SH HISTORY
86 glibc 2.1.
87 Marked obsolete in POSIX.1-2001.
88 Removed in POSIX.1-2008.
89 .SH NOTES
90 .I Do not use these functions!
91 They cannot be portably used, since they provide no way of specifying
92 the direction of growth or the range of the stack.
93 For example, on architectures with a stack that grows downward,
94 .I stackaddr
95 specifies the next address past the
96 .I highest
97 address of the allocated stack area.
98 However, on architectures with a stack that grows upward,
99 .I stackaddr
100 specifies the
101 .I lowest
102 address in the allocated stack area.
103 By contrast, the
104 .I stackaddr
105 used by
106 .BR pthread_attr_setstack (3)
107 and
108 .BR pthread_attr_getstack (3),
109 is always a pointer to the lowest address in the allocated stack area
110 (and the
111 .I stacksize
112 argument specifies the range of the stack).
113 .SH SEE ALSO
114 .BR pthread_attr_init (3),
115 .BR pthread_attr_setstack (3),
116 .BR pthread_attr_setstacksize (3),
117 .BR pthread_create (3),
118 .BR pthreads (7)