]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_attr_setstackaddr.3
tsearch.3: SYNOPSIS: add missing definition of 'VISIT' type
[thirdparty/man-pages.git] / man3 / pthread_attr_setstackaddr.3
CommitLineData
e5b89a8d
MK
1.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2.\" <mtk.manpages@gmail.com>
3.\"
93015253 4.\" %%%LICENSE_START(VERBATIM)
e5b89a8d
MK
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
8.\"
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one.
13.\"
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date. The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein. The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
21.\"
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 24.\" %%%LICENSE_END
e5b89a8d 25.\"
4b8c67d9 26.TH PTHREAD_ATTR_SETSTACKADDR 3 2017-09-15 "Linux" "Linux Programmer's Manual"
e5b89a8d
MK
27.SH NAME
28pthread_attr_setstackaddr, pthread_attr_getstackaddr \-
29set/get stack address attribute in thread attributes object
30.SH SYNOPSIS
31.nf
32.B #include <pthread.h>
dbfe9c70 33.PP
e5b89a8d
MK
34.BI "int pthread_attr_setstackaddr(pthread_attr_t *" attr \
35", void *" stackaddr );
e59f5f58 36.BI "int pthread_attr_getstackaddr(const pthread_attr_t *" attr \
e5b89a8d 37", void **" stackaddr );
68e4db0a 38.PP
e5b89a8d 39Compile and link with \fI\-pthread\fP.
6030f2d8 40.fi
e5b89a8d 41.SH DESCRIPTION
c5571b61 42These functions are obsolete:
e5b89a8d
MK
43.B do not use them.
44Use
45.BR pthread_attr_setstack (3)
46and
47.BR pthread_attr_getstack (3)
48instead.
847e0d88 49.PP
e5b89a8d
MK
50The
51.BR pthread_attr_setstackaddr ()
52function sets the stack address attribute of the
53thread attributes object referred to by
54.I attr
55to the value specified in
56.IR stackaddr .
57This attribute specifies the location of the stack that should
58be used by a thread that is created using the thread attributes object
59.IR attr .
847e0d88 60.PP
e5b89a8d
MK
61.I stackaddr
62should point to a buffer of at least
63.B PTHREAD_STACK_MIN
64bytes that was allocated by the caller.
65The pages of the allocated buffer should be both readable and writable.
847e0d88 66.PP
e5b89a8d
MK
67The
68.BR pthread_attr_getstackaddr ()
69function returns the stack address attribute of the
70thread attributes object referred to by
71.I attr
72in the buffer pointed to by
73.IR stackaddr .
74.SH RETURN VALUE
75On success, these functions return 0;
c7094399 76on error, they return a nonzero error number.
e5b89a8d
MK
77.SH ERRORS
78No errors are defined
79(but applications should nevertheless
80handle a possible error return).
81.SH VERSIONS
82These functions are provided by glibc since version 2.1.
655d3998 83.SH ATTRIBUTES
b11d75e3
PH
84For an explanation of the terms used in this section, see
85.BR attributes (7).
86.TS
87allbox;
88lbw28 lb lb
89l l l.
90Interface Attribute Value
91T{
92.BR pthread_attr_setstackaddr (),
655d3998 93.BR pthread_attr_getstackaddr ()
b11d75e3
PH
94T} Thread safety MT-Safe
95.TE
e5b89a8d
MK
96.SH CONFORMING TO
97POSIX.1-2001 specifies these functions but marks them as obsolete.
98POSIX.1-2008 removes the specification of these functions.
99.SH NOTES
100.I Do not use these functions!
101They cannot be portably used, since they provide no way of specifying
102the direction of growth or the range of the stack.
5fab2e7c 103For example, on architectures with a stack that grows downward,
e5b89a8d
MK
104.I stackaddr
105specifies the next address past the
106.I highest
107address of the allocated stack area.
5fab2e7c 108However, on architectures with a stack that grows upward,
e5b89a8d
MK
109.I stackaddr
110specifies the
111.I lowest
112address in the allocated stack area.
113By contrast, the
114.I stackaddr
115used by
116.BR pthread_attr_setstack (3)
117and
118.BR pthread_attr_getstack (3),
119is always a pointer to the lowest address in the allocated stack area
120(and the
121.I stacksize
122argument specifies the range of the stack).
123.SH SEE ALSO
124.BR pthread_attr_init (3),
125.BR pthread_attr_setstack (3),
126.BR pthread_attr_setstacksize (3),
127.BR pthread_create (3),
128.BR pthreads (7)