1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
5
<TITLE>"PTHREAD_ATTR_GETSTACKADDR"(P) manual page</TITLE>
6
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
7
<META NAME="CREATED" CONTENT="20050504;11025500">
8
<META NAME="CHANGED" CONTENT="20050505;17571400">
9
<!-- manual page source format generated by PolyglotMan v3.2, -->
10
<!-- available at http://polyglotman.sourceforge.net/ -->
12
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
13
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
14
<P><A HREF="index.html">Reference Index</A></P>
15
<P><A HREF="#toc">Table of Contents</A></P>
16
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
17
<P>pthread_attr_getstackaddr, pthread_attr_setstackaddr - get and set
18
the stackaddr attribute
20
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
21
<P><B>#include <pthread.h> </B>
23
<P><B>int pthread_attr_getstackaddr(const pthread_attr_t *restrict</B>
24
<I>attr</I><B>, void **restrict</B> <I>stackaddr</I><B>); <BR>int
25
pthread_attr_setstackaddr(pthread_attr_t *</B><I>attr</I><B>, void
26
*</B><I>stackaddr</I><B>); </B>
28
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
29
<P>The <B>pthread_attr_getstackaddr</B> and <B>pthread_attr_setstackaddr</B>
30
functions, respectively, shall get and set the thread creation
31
<I>stackaddr</I> attribute in the <I>attr</I> object.
33
<P>The <I>stackaddr</I> attribute specifies the location of storage
34
to be used for the created thread’s stack. The size of the storage
35
shall be at least {PTHREAD_STACK_MIN}.
37
<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_ATTR_STACKADDR</B> in
38
pthread.h as -1 to indicate that these routines are implemented but
39
cannot used to set or get the stack address. These routines always
40
return the error ENOSYS when called.</P>
41
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
42
<P>Upon successful completion, <B>pthread_attr_getstackaddr</B> and
43
<B>pthread_attr_setstackaddr</B> shall return a value of 0;
44
otherwise, an error number shall be returned to indicate the error.
46
<P>The <B>pthread_attr_getstackaddr</B> function stores the <I>stackaddr</I>
47
attribute value in <I>stackaddr</I> if successful.
49
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
50
<P>The <B>pthread_attr_setstackaddr</B> function always returns the
55
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOSYS</B></DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
56
The function is not supported.
60
The <B>pthread_attr_getstackaddr</B> function always returns the
65
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOSYS</B></DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
66
The function is not supported.
70
These functions shall not return an error code of [EINTR].
72
<P><I>The following sections are informative.</I>
74
<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
77
<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
78
<P>The specification of the <I>stackaddr</I> attribute presents
79
several ambiguities that make portable use of these interfaces
80
impossible. The description of the single address parameter as a
81
"stack" does not specify a particular relationship between
82
the address and the "stack" implied by that address. For
83
example, the address may be taken as the low memory address of a
84
buffer intended for use as a stack, or it may be taken as the address
85
to be used as the initial stack pointer register value for the new
86
thread. These two are not the same except for a machine on which the
87
stack grows "up" from low memory to high, and on which a
88
"push" operation first stores the value in memory and then
89
increments the stack pointer register. Further, on a machine where
90
the stack grows "down" from high memory to low,
91
interpretation of the address as the "low memory" address
92
requires a determination of the intended size of the stack.
93
IEEE Std 1003.1-2001 has introduced the new interfaces
94
<A HREF="pthread_attr_setstack.html"><B>pthread_attr_setstack</B>(3)</A>
95
and <A HREF="pthread_attr_getstack.html"><B>pthread_attr_getstack</B>(3)</A>
96
to resolve these ambiguities.
98
<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
101
<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
104
<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
105
<P><A HREF="pthread_attr_init.html"><B>pthread_attr_destroy</B>(3)</A>
106
, <A HREF="pthread_attr_init.html"><B>pthread_attr_getdetachstate</B>(3)</A>
107
, <A HREF="pthread_attr_getstack.html"><B>pthread_attr_getstack</B>(3)</A>
108
, <A HREF="pthread_attr_getstacksize.html"><B>pthread_attr_getstacksize</B>(3)</A>
109
, <A HREF="pthread_attr_setstack.html"><B>pthread_attr_setstack</B>(3)</A>
110
, <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> , the
111
Base Definitions volume of IEEE Std 1003.1-2001,
112
<I><limits.h></I>, <I><pthread.h></I>
114
<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
115
<P>Portions of this text are reprinted and reproduced in electronic
116
form from IEEE Std 1003.1, 2003 Edition, Standard for Information
117
Technology -- Portable Operating System Interface (POSIX), The Open
118
Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
119
Institute of Electrical and Electronics Engineers, Inc and The Open
120
Group. In the event of any discrepancy between this version and the
121
original IEEE and The Open Group Standard, the original IEEE and The
122
Open Group Standard is the referee document. The original Standard
123
can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
126
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
128
<P><A NAME="toc"></A><B>Table of Contents</B></P>
130
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
132
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
134
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
136
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
139
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
141
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
143
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
146
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
148
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
151
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
154
<LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>