summaryrefslogtreecommitdiff
path: root/lib/libpthread/pthread_attr_getstack.3
diff options
context:
space:
mode:
authorjruoho <jruoho@NetBSD.org>2010-07-07 12:49:15 +0000
committerjruoho <jruoho@NetBSD.org>2010-07-07 12:49:15 +0000
commit40267ee9ae50a0f772207fd8cf401a5eb426d336 (patch)
tree12779d8d479eda06b078e255f58eec22c8c16758 /lib/libpthread/pthread_attr_getstack.3
parent6f1969076692e781cfb0e3f1f5dc458ca66a734b (diff)
Fix some minor errors/typos and clarify.
Diffstat (limited to 'lib/libpthread/pthread_attr_getstack.3')
-rw-r--r--lib/libpthread/pthread_attr_getstack.318
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/libpthread/pthread_attr_getstack.3 b/lib/libpthread/pthread_attr_getstack.3
index e76a89db29a..a1c0a802822 100644
--- a/lib/libpthread/pthread_attr_getstack.3
+++ b/lib/libpthread/pthread_attr_getstack.3
@@ -1,4 +1,4 @@
-.\" $NetBSD: pthread_attr_getstack.3,v 1.1 2010/07/07 11:04:54 jruoho Exp $
+.\" $NetBSD: pthread_attr_getstack.3,v 1.2 2010/07/07 12:49:15 jruoho Exp $
.\"
.\" Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi>
.\" All rights reserved.
@@ -84,7 +84,7 @@ All pages within the stack described by
.Fa stackaddr
and
.Fa stacksize
-are both readable and writable by the thread.
+should be both readable and writable by the thread.
.Pp
The behavior is undefined in all functions if the
.Fa attr
@@ -123,10 +123,13 @@ may guarantee some degree of portability.
If the application modifies the stack address, it claims also
the responsibility of allocating the stack area and guarding it against
possible stack overflow.
-This implies that the application may need to also allocate a suitable
-guard area that is protected from reading and writing.
+No default guard area will be allocated (see
+.Xr pthread_attr_getguardsize 3 ) .
+It may be necessary to manually use
+.Xr mprotect 2
+in order to define a guard area at the end of the allocated stack.
.It
-Moreoever, if
+Moreover, if
.Fa attr
is used to create multiple threads, the stack address must be changed
by the application between successive calls to
@@ -155,7 +158,8 @@ is less than
or exceeds some system-imposed limit.
.El
.Sh SEE ALSO
-.Xr pthread_attr 3
+.Xr pthread_attr 3 ,
+.Xr pthread_attr_setguardsize 3
.Sh STANDARDS
The
.Fn pthread_attr_getstack
@@ -173,5 +177,5 @@ and
.Fn pthread_attr_setstackaddr
conform to
.St -p1003.1-2004 ,
-where these were marked as obsolescent due concerns about portability.
+where these were marked as obsolescent.
The 2008 revision removed these two functions from the specification.