summaryrefslogtreecommitdiffstats
path: root/man3/getcontext.3
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:41:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:41:07 +0000
commit3af6d22bb3850ab2bac67287e3a3d3b0e32868e5 (patch)
tree3ee7a3ec64525911fa865bb984c86d997d855527 /man3/getcontext.3
parentAdding debian version 6.05.01-1. (diff)
downloadmanpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.tar.xz
manpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.zip
Merging upstream version 6.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'man3/getcontext.3')
-rw-r--r--man3/getcontext.325
1 files changed, 12 insertions, 13 deletions
diff --git a/man3/getcontext.3 b/man3/getcontext.3
index 4cd604c..6515075 100644
--- a/man3/getcontext.3
+++ b/man3/getcontext.3
@@ -3,7 +3,7 @@
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.TH getcontext 3 2023-07-20 "Linux man-pages 6.05.01"
+.TH getcontext 3 2023-10-31 "Linux man-pages 6.7"
.SH NAME
getcontext, setcontext \- get or set the user context
.SH LIBRARY
@@ -12,7 +12,7 @@ Standard C library
.SH SYNOPSIS
.nf
.B #include <ucontext.h>
-.PP
+.P
.BI "int getcontext(ucontext_t *" ucp );
.BI "int setcontext(const ucontext_t *" ucp );
.fi
@@ -31,7 +31,7 @@ and
.BR swapcontext (3)
that allow user-level context switching between multiple
threads of control within a process.
-.PP
+.P
The
.I mcontext_t
type is machine-dependent and opaque.
@@ -39,7 +39,7 @@ The
.I ucontext_t
type is a structure that has at least
the following fields:
-.PP
+.P
.in +4n
.EX
typedef struct ucontext_t {
@@ -51,7 +51,7 @@ typedef struct ucontext_t {
} ucontext_t;
.EE
.in
-.PP
+.P
with
.I sigset_t
and
@@ -76,14 +76,14 @@ and
is the
machine-specific representation of the saved context,
that includes the calling thread's machine registers.
-.PP
+.P
The function
.BR getcontext ()
initializes the structure
pointed to by
.I ucp
to the currently active context.
-.PP
+.P
The function
.BR setcontext ()
restores the user context
@@ -99,11 +99,11 @@ handler (see the discussion of the
.B SA_SIGINFO
flag in
.BR sigaction (2)).
-.PP
+.P
If the context was obtained by a call of
.BR getcontext (),
program execution continues as if this call just returned.
-.PP
+.P
If the context was obtained by a call of
.BR makecontext (3),
program execution continues by a call to the function
@@ -120,7 +120,7 @@ specified as the
first argument of that call to
.BR makecontext (3).
When this member is NULL, the thread exits.
-.PP
+.P
If the context was obtained by a call to a signal handler,
then old standard text says that "program execution continues with the
program instruction following the instruction interrupted
@@ -153,12 +153,11 @@ T{
.BR setcontext ()
T} Thread safety MT-Safe race:ucp
.TE
-.sp 1
.SH STANDARDS
None.
.SH HISTORY
SUSv2, POSIX.1-2001.
-.PP
+.P
POSIX.1-2008 removes these functions,
citing portability issues, and
recommending that applications be rewritten to use POSIX threads instead.
@@ -181,7 +180,7 @@ is from the first call, or via a
call.
The user has to invent their own bookkeeping device, and a register
variable won't do since registers are restored.
-.PP
+.P
When a signal occurs, the current user context is saved and
a new context is created by the kernel for the signal handler.
Do not leave the handler using