share/mk/: build-html: Don't build mbind.2 and set_mempolicy.2
[man-pages.git] / man3 / pthread_attr_setstackaddr.3
blob7f72b0f5991cccb0a7816392749b0089f177fe79
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>
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.
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 .
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.
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 .TS
69 allbox;
70 lbx lb lb
71 l l l.
72 Interface       Attribute       Value
74 .na
75 .nh
76 .BR pthread_attr_setstackaddr (),
77 .BR pthread_attr_getstackaddr ()
78 T}      Thread safety   MT-Safe
79 .TE
80 .SH STANDARDS
81 None.
82 .SH HISTORY
83 glibc 2.1.
84 Marked obsolete in POSIX.1-2001.
85 Removed in POSIX.1-2008.
86 .SH NOTES
87 .I Do not use these functions!
88 They cannot be portably used, since they provide no way of specifying
89 the direction of growth or the range of the stack.
90 For example, on architectures with a stack that grows downward,
91 .I stackaddr
92 specifies the next address past the
93 .I highest
94 address of the allocated stack area.
95 However, on architectures with a stack that grows upward,
96 .I stackaddr
97 specifies the
98 .I lowest
99 address in the allocated stack area.
100 By contrast, the
101 .I stackaddr
102 used by
103 .BR pthread_attr_setstack (3)
105 .BR pthread_attr_getstack (3),
106 is always a pointer to the lowest address in the allocated stack area
107 (and the
108 .I stacksize
109 argument specifies the range of the stack).
110 .SH SEE ALSO
111 .BR pthread_attr_init (3),
112 .BR pthread_attr_setstack (3),
113 .BR pthread_attr_setstacksize (3),
114 .BR pthread_create (3),
115 .BR pthreads (7)