Module Name: src
Committed By: riastradh
Date: Thu Dec 7 17:15:48 UTC 2023
Modified Files:
src/share/man/man7: stack.7
Log Message:
stack(7): Minor clarifications and wording tweaks.
Suggested by pgoyette@ and uwe@.
PR pkg/57708
XXX pullup-10
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man7/stack.7
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/man/man7/stack.7
diff -u src/share/man/man7/stack.7:1.4 src/share/man/man7/stack.7:1.5
--- src/share/man/man7/stack.7:1.4 Thu Nov 23 21:44:55 2023
+++ src/share/man/man7/stack.7 Thu Dec 7 17:15:48 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: stack.7,v 1.4 2023/11/23 21:44:55 riastradh Exp $
+.\" $NetBSD: stack.7,v 1.5 2023/12/07 17:15:48 riastradh Exp $
.\"
.\" Copyright (c) 2023 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -133,8 +133,7 @@ although the term
is also sometimes used to mean a fixed space
.Em above
the stack pointer (in the direction of stack growth) that the system
-guarantees will it will not overwrite when calling a signal handler in
-the
+guarantees it will not overwrite when calling a signal handler in the
.Tn ABI
of some architectures; see also
.Xr sigaltstack 2
@@ -187,8 +186,9 @@ are defined in
.Ss Non-main threads
Threads created with
.Xr pthread_create 3
-have stacks allocated at dynamically chosen addresses, and the stacks
-cannot be resized after creation.
+have stacks allocated at dynamically chosen addresses outside the main
+thread's stack region by default, and their stacks cannot be resized
+after creation.
On architectures where the stack grows down, the layout is:
.Bd -literal
+--------------------+ stackaddr
@@ -243,11 +243,13 @@ guardsize is the value of the
.Li vm.guard_size
.Xr sysctl 7
knob at the time of program startup.
-(Note that this means the
+.Po
+Note that this means the
.Xr pthread 3
view of the main thread's stack guard may not coincide with the actual
stack guard \(em it may overlap with, or lie entirely in, the
-inaccessible pages of the stack reserved on program start.)
+inaccessible pages of the stack reserved on program start.
+.Pc
However, if the program changes its soft stack rlimit with
.Xr setrlimit 2 ,
this snapshot may become stale.