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.
39 These functions are obsolete:
42 .BR pthread_attr_setstack (3)
44 .BR pthread_attr_getstack (3)
48 .BR pthread_attr_setstackaddr ()
49 function sets the stack address attribute of the
50 thread attributes object referred to by
52 to the value specified in
54 This attribute specifies the location of the stack that should
55 be used by a thread that is created using the thread attributes object
59 should point to a buffer of at least
61 bytes that was allocated by the caller.
62 The pages of the allocated buffer should be both readable and writable.
65 .BR pthread_attr_getstackaddr ()
66 function returns the stack address attribute of the
67 thread attributes object referred to by
69 in the buffer pointed to by
72 On success, these functions return 0;
73 on error, they return a nonzero error number.
76 (but applications should nevertheless
77 handle a possible error return).
79 These functions are provided by glibc since version 2.1.
81 POSIX.1-2001 specifies these functions but marks them as obsolete.
82 POSIX.1-2008 removes the specification of these functions.
84 .I Do not use these functions!
85 They cannot be portably used, since they provide no way of specifying
86 the direction of growth or the range of the stack.
87 For example, on architectures with a stack that grows downward,
89 specifies the next address past the
91 address of the allocated stack area.
92 However, on architectures with a stack that grows upward,
96 address in the allocated stack area.
100 .BR pthread_attr_setstack (3)
102 .BR pthread_attr_getstack (3),
103 is always a pointer to the lowest address in the allocated stack area
106 argument specifies the range of the stack).
108 .BR pthread_attr_init (3),
109 .BR pthread_attr_setstack (3),
110 .BR pthread_attr_setstacksize (3),
111 .BR pthread_create (3),