4.2BSD/usr/man/man3/setjmp.3

Compare this file to the similar file:
Show the results in this format:

.TH SETJMP 3 "19 January 1983"
.UC 4
.SH NAME
setjmp, longjmp \- non-local goto
.SH SYNOPSIS
.nf
.B #include <setjmp.h>
.PP
.B setjmp(env)
.B jmp_buf env;
.PP
.B longjmp(env, val)
.B jmp_buf env;
.PP
.B _setjmp(env)
.B jmp_buf env;
.PP
.B _longjmp(env, val)
.B jmp_buf env;
.fi
.SH DESCRIPTION
These routines are useful for dealing with errors 
and interrupts encountered in
a low-level subroutine of a program.
.PP
.I Setjmp 
saves its stack environment in
.I env
for later use by
.I longjmp.
It returns value 0.
.PP
.I Longjmp
restores the environment saved by the last call of
.IR setjmp .
It then returns in such a way that execution
continues as if the call of 
.I setjmp
had just returned the value
.I val
to the function that invoked
.I setjmp,
which must not itself have returned in the interim.
All accessible data have values as of the time
.I longjmp
was called.
.PP
.I Setjmp
and
.I longjmp
save and restore the signal mask
.IR sigmask (2),
while
.I _setjmp
and
.I _longjmp
manipulate only the C stack and registers.
.SH "SEE ALSO"
sigvec(2), sigstack(2), signal(3)
.SH BUGS
.I Setjmp
does not save current notion of whether the process is
executing on the signal stack.  The result is that a
longjmp to some place on the signal stack leaves the
signal stack state incorrect.