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