]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_attr_setstackaddr.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / pthread_attr_setstackaddr.3
CommitLineData
a1eaacb1 1'\" t
e5b89a8d
MK
2.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
3.\" <mtk.manpages@gmail.com>
4.\"
5fbde956 5.\" SPDX-License-Identifier: Linux-man-pages-copyleft
e5b89a8d 6.\"
4c1c5274 7.TH pthread_attr_setstackaddr 3 (date) "Linux man-pages (unreleased)"
e5b89a8d
MK
8.SH NAME
9pthread_attr_setstackaddr, pthread_attr_getstackaddr \-
10set/get stack address attribute in thread attributes object
d8f2ce5c
AC
11.SH LIBRARY
12POSIX threads library
8fc3b2cf 13.RI ( libpthread ", " \-lpthread )
e5b89a8d
MK
14.SH SYNOPSIS
15.nf
16.B #include <pthread.h>
dbfe9c70 17.PP
4131356c 18.B [[deprecated]]
e5b89a8d
MK
19.BI "int pthread_attr_setstackaddr(pthread_attr_t *" attr \
20", void *" stackaddr );
4131356c 21.B [[deprecated]]
4517c06e
AC
22.BI "int pthread_attr_getstackaddr(const pthread_attr_t *restrict " attr ,
23.BI " void **restrict " stackaddr );
6030f2d8 24.fi
e5b89a8d 25.SH DESCRIPTION
c5571b61 26These functions are obsolete:
e5b89a8d
MK
27.B do not use them.
28Use
29.BR pthread_attr_setstack (3)
30and
31.BR pthread_attr_getstack (3)
32instead.
847e0d88 33.PP
e5b89a8d
MK
34The
35.BR pthread_attr_setstackaddr ()
36function sets the stack address attribute of the
37thread attributes object referred to by
38.I attr
39to the value specified in
40.IR stackaddr .
41This attribute specifies the location of the stack that should
42be used by a thread that is created using the thread attributes object
43.IR attr .
847e0d88 44.PP
e5b89a8d
MK
45.I stackaddr
46should point to a buffer of at least
47.B PTHREAD_STACK_MIN
48bytes that was allocated by the caller.
49The pages of the allocated buffer should be both readable and writable.
847e0d88 50.PP
e5b89a8d
MK
51The
52.BR pthread_attr_getstackaddr ()
53function returns the stack address attribute of the
54thread attributes object referred to by
55.I attr
56in the buffer pointed to by
57.IR stackaddr .
58.SH RETURN VALUE
59On success, these functions return 0;
c7094399 60on error, they return a nonzero error number.
e5b89a8d
MK
61.SH ERRORS
62No errors are defined
63(but applications should nevertheless
64handle a possible error return).
655d3998 65.SH ATTRIBUTES
b11d75e3
PH
66For an explanation of the terms used in this section, see
67.BR attributes (7).
68.TS
69allbox;
c466875e 70lbx lb lb
b11d75e3
PH
71l l l.
72Interface Attribute Value
73T{
9e54434e
BR
74.na
75.nh
b11d75e3 76.BR pthread_attr_setstackaddr (),
655d3998 77.BR pthread_attr_getstackaddr ()
b11d75e3
PH
78T} Thread safety MT-Safe
79.TE
c466875e 80.sp 1
3113c7f3 81.SH STANDARDS
4131356c
AC
82None.
83.SH HISTORY
84glibc 2.1.
85Marked obsolete in POSIX.1-2001.
86Removed in POSIX.1-2008.
e5b89a8d
MK
87.SH NOTES
88.I Do not use these functions!
89They cannot be portably used, since they provide no way of specifying
90the direction of growth or the range of the stack.
5fab2e7c 91For example, on architectures with a stack that grows downward,
e5b89a8d
MK
92.I stackaddr
93specifies the next address past the
94.I highest
95address of the allocated stack area.
5fab2e7c 96However, on architectures with a stack that grows upward,
e5b89a8d
MK
97.I stackaddr
98specifies the
99.I lowest
100address in the allocated stack area.
101By contrast, the
102.I stackaddr
103used by
104.BR pthread_attr_setstack (3)
105and
106.BR pthread_attr_getstack (3),
107is always a pointer to the lowest address in the allocated stack area
108(and the
109.I stacksize
110argument specifies the range of the stack).
111.SH SEE ALSO
112.BR pthread_attr_init (3),
113.BR pthread_attr_setstack (3),
114.BR pthread_attr_setstacksize (3),
115.BR pthread_create (3),
116.BR pthreads (7)