summaryrefslogtreecommitdiffstats
path: root/man3/pthread_attr_setguardsize.3
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--man3/pthread_attr_setguardsize.321
1 files changed, 10 insertions, 11 deletions
diff --git a/man3/pthread_attr_setguardsize.3 b/man3/pthread_attr_setguardsize.3
index 7d8d8cb..b436260 100644
--- a/man3/pthread_attr_setguardsize.3
+++ b/man3/pthread_attr_setguardsize.3
@@ -4,7 +4,7 @@
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.TH pthread_attr_setguardsize 3 2023-07-20 "Linux man-pages 6.05.01"
+.TH pthread_attr_setguardsize 3 2023-10-31 "Linux man-pages 6.7"
.SH NAME
pthread_attr_setguardsize, pthread_attr_getguardsize \- set/get guard size
attribute in thread attributes object
@@ -14,7 +14,7 @@ POSIX threads library
.SH SYNOPSIS
.nf
.B #include <pthread.h>
-.PP
+.P
.BI "int pthread_attr_setguardsize(pthread_attr_t *" attr \
", size_t " guardsize );
.BI "int pthread_attr_getguardsize(const pthread_attr_t *restrict " attr ,
@@ -28,7 +28,7 @@ thread attributes object referred to by
.I attr
to the value specified in
.IR guardsize .
-.PP
+.P
If
.I guardsize
is greater than 0,
@@ -38,15 +38,15 @@ the system allocates an additional region of at least
.I guardsize
bytes at the end of the thread's stack to act as the guard area
for the stack (but see BUGS).
-.PP
+.P
If
.I guardsize
is 0, then new threads created with
.I attr
will not have a guard area.
-.PP
+.P
The default guard size is the same as the system page size.
-.PP
+.P
If the stack address attribute has been set in
.I attr
(using
@@ -61,7 +61,7 @@ it is the application's responsibility to handle stack overflow
.BR mprotect (2)
to manually define a guard area at the end of the stack
that it has allocated).
-.PP
+.P
The
.BR pthread_attr_getguardsize ()
function returns the guard size attribute of the
@@ -98,7 +98,6 @@ T{
.BR pthread_attr_getguardsize ()
T} Thread safety MT-Safe
.TE
-.sp 1
.SH STANDARDS
POSIX.1-2008.
.SH HISTORY
@@ -118,11 +117,11 @@ the system page size when creating a thread.
.BR pthread_attr_getguardsize ()
returns the guard size that was set by
.BR pthread_attr_setguardsize ().)
-.PP
+.P
Setting a guard size of 0 may be useful to save memory
in an application that creates many threads
and knows that stack overflow can never occur.
-.PP
+.P
Choosing a guard size larger than the default size
may be necessary for detecting stack overflows
if a thread allocates large data structures on the stack.
@@ -137,7 +136,7 @@ error from
.BR pthread_create (3)
if the guard size value is too large,
leaving no space for the actual stack.)
-.PP
+.P
The obsolete LinuxThreads implementation did the right thing,
allocating extra space at the end of the stack for the guard area.
.\" glibc includes the guardsize within the allocated stack size,