pthread_attr_setstackaddr.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
  5. <TITLE>&quot;PTHREAD_ATTR_GETSTACKADDR&quot;(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/ -->
  11. </HEAD>
  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
  19. </P>
  20. <H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
  21. <P><B>#include &lt;pthread.h&gt; </B>
  22. </P>
  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>
  27. </P>
  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.
  32. </P>
  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}.
  36. </P>
  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.
  45. </P>
  46. <P>The <B>pthread_attr_getstackaddr</B> function stores the <I>stackaddr</I>
  47. attribute value in <I>stackaddr</I> if successful.
  48. </P>
  49. <H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
  50. <P>The <B>pthread_attr_setstackaddr</B> function always returns the
  51. following error code:
  52. </P>
  53. <DL>
  54. <DL>
  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.
  57. </DD></DL>
  58. </DL>
  59. <P>
  60. The <B>pthread_attr_getstackaddr</B> function always returns the
  61. following error code:
  62. </P>
  63. <DL>
  64. <DL>
  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.
  67. </DD></DL>
  68. </DL>
  69. <P>
  70. These functions shall not return an error code of [EINTR].
  71. </P>
  72. <P><I>The following sections are informative.</I>
  73. </P>
  74. <H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
  75. <P>None.
  76. </P>
  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. &quot;stack&quot; does not specify a particular relationship between
  82. the address and the &quot;stack&quot; 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 &quot;up&quot; from low memory to high, and on which a
  88. &quot;push&quot; operation first stores the value in memory and then
  89. increments the stack pointer register. Further, on a machine where
  90. the stack grows &quot;down&quot; from high memory to low,
  91. interpretation of the address as the &quot;low memory&quot; address
  92. requires a determination of the intended size of the stack.
  93. IEEE&nbsp;Std&nbsp;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.
  97. </P>
  98. <H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
  99. <P>None.
  100. </P>
  101. <H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
  102. <P>None.
  103. </P>
  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&nbsp;Std&nbsp;1003.1-2001,
  112. <I>&lt;limits.h&gt;</I>, <I>&lt;pthread.h&gt;</I>
  113. </P>
  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>
  124. .
  125. </P>
  126. <P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
  127. <HR>
  128. <P><A NAME="toc"></A><B>Table of Contents</B></P>
  129. <UL>
  130. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
  131. </P>
  132. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
  133. </P>
  134. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
  135. </P>
  136. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
  137. Value</A>
  138. </P>
  139. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
  140. </P>
  141. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
  142. </P>
  143. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
  144. Usage</A>
  145. </P>
  146. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
  147. </P>
  148. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
  149. Directions</A>
  150. </P>
  151. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
  152. Also</A>
  153. </P>
  154. <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
  155. </P>
  156. </UL>
  157. </BODY>
  158. </HTML>