2 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .TH pthread_attr_setstackaddr 3 (date) "Linux man-pages (unreleased)"
9 pthread_attr_setstackaddr, pthread_attr_getstackaddr \-
10 set/get stack address attribute in thread attributes object
13 .RI ( libpthread ", " \-lpthread )
16 .B #include <pthread.h>
19 .BI "int pthread_attr_setstackaddr(pthread_attr_t *" attr \
20 ", void *" stackaddr );
22 .BI "int pthread_attr_getstackaddr(const pthread_attr_t *restrict " attr ,
23 .BI " void **restrict " stackaddr );
26 These functions are obsolete:
29 .BR pthread_attr_setstack (3)
31 .BR pthread_attr_getstack (3)
35 .BR pthread_attr_setstackaddr ()
36 function sets the stack address attribute of the
37 thread attributes object referred to by
39 to the value specified in
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
46 should point to a buffer of at least
48 bytes that was allocated by the caller.
49 The pages of the allocated buffer should be both readable and writable.
52 .BR pthread_attr_getstackaddr ()
53 function returns the stack address attribute of the
54 thread attributes object referred to by
56 in the buffer pointed to by
59 On success, these functions return 0;
60 on error, they return a nonzero error number.
63 (but applications should nevertheless
64 handle a possible error return).
66 For an explanation of the terms used in this section, see
74 Interface Attribute Value
76 .BR pthread_attr_setstackaddr (),
77 .BR pthread_attr_getstackaddr ()
78 T} Thread safety MT-Safe
87 Marked obsolete in POSIX.1-2001.
88 Removed in POSIX.1-2008.
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,
95 specifies the next address past the
97 address of the allocated stack area.
98 However, on architectures with a stack that grows upward,
102 address in the allocated stack area.
106 .BR pthread_attr_setstack (3)
108 .BR pthread_attr_getstack (3),
109 is always a pointer to the lowest address in the allocated stack area
112 argument specifies the range of the stack).
114 .BR pthread_attr_init (3),
115 .BR pthread_attr_setstack (3),
116 .BR pthread_attr_setstacksize (3),
117 .BR pthread_create (3),