xref: /netbsd/share/man/man2/ucontext.2 (revision 6550d01e)
1.\"	$NetBSD: ucontext.2,v 1.6 2010/04/29 06:07:35 jruoho Exp $
2.\"
3.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Klaus Klein.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd April 29, 2010
31.Dt UCONTEXT 2
32.Os
33.Sh NAME
34.Nm ucontext
35.Nd user context
36.Sh SYNOPSIS
37.In ucontext.h
38.Sh DESCRIPTION
39The
40.Vt ucontext_t
41is a structure type which is used to describe the context of a
42thread of control within the execution of a process.
43A thread's context includes its stack, saved registers, and list of
44blocked signals.
45.Pp
46The
47.Vt ucontext_t
48structure includes the following members:
49.Bd -literal -offset indent
50ucontext_t *uc_link
51sigset_t    uc_sigmask
52stack_t     uc_stack
53mcontext_t  uc_mcontext
54.Ed
55.Pp
56The
57.Fa uc_link
58member points to the context that will be resumed after the function
59specified when modifying a context using
60.Xr makecontext 3
61has returned.
62If
63.Fa uc_link
64is a
65.Dv NULL
66pointer, then the context is the main context,
67and the process will exit with an exit status of 0 upon return.
68.Pp
69The
70.Fa uc_sigmask
71member is the set of signals that are blocked when the context is
72activated.
73Further information can be found in
74.Xr sigprocmask 2 .
75.Pp
76The
77.Fa uc_stack
78member defines the stack used by the context.
79Further information can be found in
80.Xr sigaltstack 2 .
81.Pp
82The
83.Fa uc_mcontext
84member defines the machine state associated with the context;
85it may consist of general registers, floating point registers
86and other machine-specific information.
87Its description is beyond the scope of this manual page;
88portable applications should not access this structure member.
89.Sh SEE ALSO
90.Xr _exit 2 ,
91.Xr getcontext 2 ,
92.Xr setcontext 2 ,
93.Xr sigaltstack 2 ,
94.Xr sigprocmask 2 ,
95.Xr makecontext 3 ,
96.Xr swapcontext 3
97.Sh STANDARDS
98The
99.Vt ucontext_t
100type conforms to
101.St -xsh5
102and
103.St -p1003.1-2001 .
104The
105.St -p1003.1-2008
106revision removed the
107.Vt ucontext_t
108from the specification.
109