1.\" $NetBSD: ucontext.2,v 1.3 2008/04/30 13:10:53 martin 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 June 13, 2001 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 39.Nm ucontext_t 40is a structure type which is used to describe the context of a 41thread of control within the execution of a process. 42.Pp 43.Nm ucontext_t 44includes the following members: 45.Bd -literal -offset indent 46ucontext_t * uc_link 47sigset_t uc_sigmask 48stack_t uc_stack 49mcontext_t uc_mcontext 50.Ed 51.Pp 52The 53.Fa uc_link 54member points to the context that will be resumed after the function 55specified when modifying a context using 56.Xr makecontext 3 57has returned. 58If 59.Fa uc_link 60is a null pointer, then the context is the main context, 61and the process will exit with an exit status of 0 upon return. 62.Pp 63The 64.Fa uc_sigmask 65member is the set of signals that are blocked when the context is 66activated. 67Further information can be found in 68.Xr sigprocmask 2 . 69.Pp 70The 71.Fa uc_stack 72member defines the stack used by the context. 73Further information can be found in 74.Xr sigaltstack 2 . 75.Pp 76The 77.Fa uc_mcontext 78member defines the machine state associated with the context; 79it may consist of general registers, floating point registers 80and other machine-specific information. 81Its description is beyond the scope of this manual page; 82portable applications should not access this structure member. 83.Sh SEE ALSO 84.Xr _exit 2 , 85.Xr getcontext 2 , 86.Xr setcontext 2 , 87.Xr sigaltstack 2 , 88.Xr sigprocmask 2 , 89.Xr makecontext 3 , 90.Xr swapcontext 3 91.Sh STANDARDS 92The 93.Nm ucontext_t 94type conforms to 95.St -xsh5 . 96.Sh HISTORY 97The 98.Fn makecontext 99and 100.Fn swapcontext 101functions first appeared in 102.At V.4 . 103