NetBSD/share/man/man2/ucontext.2

110 lines
3.6 KiB
Groff

.\" $NetBSD: ucontext.2,v 1.1 2003/10/14 14:59:04 wiz Exp $
.\"
.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Klaus Klein.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the NetBSD
.\" Foundation, Inc. and its contributors.
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd June 13, 2001
.Dt UCONTEXT 2
.Os
.Sh NAME
.Nm ucontext
.Nd user context
.Sh SYNOPSIS
.In ucontext.h
.Sh DESCRIPTION
.Nm ucontext_t
is a structure type which is used to describe the context of a
thread of control within the execution of a process.
.Pp
.Nm ucontext_t
includes the following members:
.Bd -literal -offset indent
ucontext_t * uc_link
sigset_t uc_sigmask
stack_t uc_stack
mcontext_t uc_mcontext
.Ed
.Pp
The
.Fa uc_link
member points to the context that will be resumed after the function
specified when modifying a context using
.Xr makecontext 3
has returned.
If
.Fa uc_link
is a null pointer, then the context is the main context,
and the process will exit with an exit status of 0 upon return.
.Pp
The
.Fa uc_sigmask
member is the set of signals that are blocked when the context is
activated.
Further information can be found in
.Xr sigprocmask 2 .
.Pp
The
.Fa uc_stack
member defines the stack used by the context.
Further information can be found in
.Xr sigaltstack 2 .
.Pp
The
.Fa uc_mcontext
member defines the machine state associated with the context;
it may consist of general registers, floating point registers
and other machine-specific infomation.
Its description is beyond the scope of this manual page;
portable applications should not access this structure member.
.Sh SEE ALSO
.Xr _exit 2 ,
.Xr getcontext 2 ,
.Xr setcontext 2 ,
.Xr sigaltstack 2 ,
.Xr sigprocmask 2 ,
.Xr makecontext 3 ,
.Xr swapcontext 3
.Sh STANDARDS
The
.Nm ucontext_t
type conforms to
.St -xsh5 .
.Sh HISTORY
The
.Fn makecontext
and
.Fn swapcontext
functions first appeared in
.At V.4 .