1 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .TH PTHREAD_ATTR_SETSTACKADDR 3 2008-10-24 "Linux" "Linux Programmer's Manual"
26 pthread_attr_setstackaddr, pthread_attr_getstackaddr \-
27 set/get stack address attribute in thread attributes object
30 .B #include <pthread.h>
32 .BI "int pthread_attr_setstackaddr(pthread_attr_t *" attr \
33 ", void *" stackaddr );
34 .BI "int pthread_attr_getstackaddr(pthread_attr_t *" attr \
35 ", void **" stackaddr );
37 Compile and link with \fI\-pthread\fP.
40 These functions are obsolete:
43 .BR pthread_attr_setstack (3)
45 .BR pthread_attr_getstack (3)
49 .BR pthread_attr_setstackaddr ()
50 function sets the stack address attribute of the
51 thread attributes object referred to by
53 to the value specified in
55 This attribute specifies the location of the stack that should
56 be used by a thread that is created using the thread attributes object
60 should point to a buffer of at least
62 bytes that was allocated by the caller.
63 The pages of the allocated buffer should be both readable and writable.
66 .BR pthread_attr_getstackaddr ()
67 function returns the stack address attribute of the
68 thread attributes object referred to by
70 in the buffer pointed to by
73 On success, these functions return 0;
74 on error, they return a nonzero error number.
77 (but applications should nevertheless
78 handle a possible error return).
80 These functions are provided by glibc since version 2.1.
82 POSIX.1-2001 specifies these functions but marks them as obsolete.
83 POSIX.1-2008 removes the specification of these functions.
85 .I Do not use these functions!
86 They cannot be portably used, since they provide no way of specifying
87 the direction of growth or the range of the stack.
88 For example, on architectures with a stack that grows downward,
90 specifies the next address past the
92 address of the allocated stack area.
93 However, on architectures with a stack that grows upward,
97 address in the allocated stack area.
101 .BR pthread_attr_setstack (3)
103 .BR pthread_attr_getstack (3),
104 is always a pointer to the lowest address in the allocated stack area
107 argument specifies the range of the stack).
109 .BR pthread_attr_init (3),
110 .BR pthread_attr_setstack (3),
111 .BR pthread_attr_setstacksize (3),
112 .BR pthread_create (3),