pthread_attr_setstacksize.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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_GETSTACKSIZE&quot;(P) manual page</TITLE>
  6. <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
  7. <META NAME="CREATED" CONTENT="20050504;11224900">
  8. <META NAME="CHANGED" CONTENT="20050505;18003200">
  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_getstacksize, pthread_attr_setstacksize - get and set
  18. the stacksize 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_getstacksize(const pthread_attr_t *restrict</B>
  24. <I>attr</I><B>, size_t *restrict</B> <I>stacksize</I><B>); <BR>int
  25. pthread_attr_setstacksize(pthread_attr_t *</B><I>attr</I><B>, size_t</B>
  26. <I>stacksize</I><B>); </B>
  27. </P>
  28. <H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
  29. <P>The <B>pthread_attr_getstacksize</B> and <B>pthread_attr_setstacksize</B>
  30. functions, respectively, shall get and set the thread creation
  31. <I>stacksize</I> attribute in the <I>attr</I> object.
  32. </P>
  33. <P>The <I>stacksize</I> attribute shall define the minimum stack size
  34. (in bytes) allocated for the created threads stack.
  35. </P>
  36. <P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_ATTR_STACKSIZE</B> in
  37. pthread.h to indicate that these routines are implemented and may be
  38. used to set or get the stack size.</P>
  39. <P>Default value: 0 (in Pthreads-w32 a value of 0 means the stack
  40. will grow as required)</P>
  41. <H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
  42. <P>Upon successful completion, <B>pthread_attr_getstacksize</B> and
  43. <B>pthread_attr_setstacksize</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_getstacksize</B> function stores the <I>stacksize</I>
  47. attribute value in <I>stacksize</I> if successful.
  48. </P>
  49. <H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
  50. <P>The <B>pthread_attr_setstacksize</B> function shall fail if:
  51. </P>
  52. <DL>
  53. <DT><B>EINVAL</B>
  54. </DT><DD STYLE="margin-bottom: 0.5cm">
  55. The value of <I>stacksize</I> is less than {PTHREAD_STACK_MIN} or
  56. exceeds a system-imposed limit.
  57. </DD></DL>
  58. <P>
  59. These functions shall not return an error code of [EINTR].
  60. </P>
  61. <P><I>The following sections are informative.</I>
  62. </P>
  63. <H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
  64. <P>None.
  65. </P>
  66. <H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
  67. <P>None.
  68. </P>
  69. <H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
  70. <P>None.
  71. </P>
  72. <H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
  73. <P>None.
  74. </P>
  75. <H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
  76. <P><A HREF="pthread_attr_init.html"><B>pthread_attr_destroy</B>(3)</A>
  77. <B>,</B> <A HREF="pthread_attr_setstackaddr.html"><B>pthread_attr_getstackaddr</B>(3)</A>
  78. <B>,</B> <A HREF="pthread_attr_init.html"><B>pthread_attr_getdetachstate</B>(3)</A>
  79. <B>,</B> <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> <B>,</B>
  80. the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001,
  81. <I>&lt;limits.h&gt;</I>, <I>&lt;pthread.h&gt;</I>
  82. </P>
  83. <H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
  84. <P>Portions of this text are reprinted and reproduced in electronic
  85. form from IEEE Std 1003.1, 2003 Edition, Standard for Information
  86. Technology -- Portable Operating System Interface (POSIX), The Open
  87. Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
  88. Institute of Electrical and Electronics Engineers, Inc and The Open
  89. Group. In the event of any discrepancy between this version and the
  90. original IEEE and The Open Group Standard, the original IEEE and The
  91. Open Group Standard is the referee document. The original Standard
  92. can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
  93. .
  94. </P>
  95. <P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
  96. <HR>
  97. <P><A NAME="toc"></A><B>Table of Contents</B></P>
  98. <UL>
  99. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
  100. </P>
  101. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
  102. </P>
  103. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
  104. </P>
  105. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
  106. Value</A>
  107. </P>
  108. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
  109. </P>
  110. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
  111. </P>
  112. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
  113. Usage</A>
  114. </P>
  115. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
  116. </P>
  117. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
  118. Directions</A>
  119. </P>
  120. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
  121. Also</A>
  122. </P>
  123. <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
  124. </P>
  125. </UL>
  126. </BODY>
  127. </HTML>