sigaltstack.2: Clarify that the alternate signal stack is per-thread

Clarify that the alternate signal stack is per-thread (rather
than process-wide).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2020-11-12 14:32:26 +01:00
parent 52e5819c41
commit 3b7d89960a
1 changed files with 10 additions and 10 deletions

View File

@ -49,7 +49,7 @@ _XOPEN_SOURCE\ >=\ 500
.ad
.SH DESCRIPTION
.BR sigaltstack ()
allows a process to define a new alternate
allows a thread to define a new alternate
signal stack and/or retrieve the state of an existing
alternate signal stack.
An alternate signal stack is used during the
@ -153,15 +153,15 @@ address and size of that stack.
The \fIold_ss.ss_flags\fP may return either of the following values:
.TP
.B SS_ONSTACK
The process is currently executing on the alternate signal stack.
The thread is currently executing on the alternate signal stack.
(Note that it is not possible
to change the alternate signal stack if the process is
to change the alternate signal stack if the thread is
currently executing on it.)
.TP
.B SS_DISABLE
The alternate signal stack is currently disabled.
.IP
Alternatively, this value is returned if the process is currently
Alternatively, this value is returned if the thread is currently
executing on an alternate signal stack that was established using the
.B SS_AUTODISARM
flag.
@ -208,7 +208,7 @@ was less than
.TP
.B EPERM
An attempt was made to change the alternate signal stack while
it was active (i.e., the process was already executing
it was active (i.e., the thread was already executing
on the current alternate signal stack).
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
@ -232,18 +232,18 @@ flag is a Linux extension.
The most common usage of an alternate signal stack is to handle the
.B SIGSEGV
signal that is generated if the space available for the
normal process stack is exhausted: in this case, a signal handler for
standard stack is exhausted: in this case, a signal handler for
.B SIGSEGV
cannot be invoked on the process stack; if we wish to handle it,
cannot be invoked on the standard stack; if we wish to handle it,
we must use an alternate signal stack.
.PP
Establishing an alternate signal stack is useful if a process
Establishing an alternate signal stack is useful if a thread
expects that it may exhaust its standard stack.
This may occur, for example, because the stack grows so large
that it encounters the upwardly growing heap, or it reaches a
limit established by a call to \fBsetrlimit(RLIMIT_STACK, &rlim)\fP.
If the standard stack is exhausted, the kernel sends
the process a \fBSIGSEGV\fP signal.
the thread a \fBSIGSEGV\fP signal.
In these circumstances the only way to catch this signal is
on an alternate signal stack.
.PP
@ -256,7 +256,7 @@ of the direction of stack growth.
Functions called from a signal handler executing on an alternate
signal stack will also use the alternate signal stack.
(This also applies to any handlers invoked for other signals while
the process is executing on the alternate signal stack.)
the thread is executing on the alternate signal stack.)
Unlike the standard stack, the system does not
automatically extend the alternate signal stack.
Exceeding the allocated size of the alternate signal stack will