SETJMP(3) BSD Programmer's Manual SETJMP(3)
s
\bsi
\big
\bgs
\bse
\bet
\btj
\bjm
\bmp
\bp, s
\bsi
\big
\bgl
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp, s
\bse
\bet
\btj
\bjm
\bmp
\bp, l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp, _
\b_s
\bse
\bet
\btj
\bjm
\bmp
\bp, _
\b_l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bpe
\ber
\brr
\bro
\bor
\br -
S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
#
\b#i
\bin
\bnc
\bcl
\blu
\bud
\bde
\be <
\b<s
\bse
\bet
\btj
\bjm
\bmp
\bp.
\b.h
\bh>
\b>
s
\bsi
\big
\bgs
\bse
\bet
\btj
\bjm
\bmp
\bp(_
\bs_
\bi_
\bg_
\bj_
\bm_
\bp_
\b__
\bb_
\bu_
\bf _
\be_
\bn_
\bv, _
\bi_
\bn_
\bt _
\bs_
\ba_
\bv_
\be_
\bm_
\ba_
\bs_
\bk);
s
\bsi
\big
\bgl
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp(_
\bs_
\bi_
\bg_
\bj_
\bm_
\bp_
\b__
\bb_
\bu_
\bf _
\be_
\bn_
\bv, _
\bi_
\bn_
\bt _
\bv_
\ba_
\bl);
s
\bse
\bet
\btj
\bjm
\bmp
\bp(_
\bj_
\bm_
\bp_
\b__
\bb_
\bu_
\bf _
\be_
\bn_
\bv);
l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp(_
\bj_
\bm_
\bp_
\b__
\bb_
\bu_
\bf _
\be_
\bn_
\bv, _
\bi_
\bn_
\bt _
\bv_
\ba_
\bl);
_
\b_s
\bse
\bet
\btj
\bjm
\bmp
\bp(_
\bj_
\bm_
\bp_
\b__
\bb_
\bu_
\bf _
\be_
\bn_
\bv);
_
\b_l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp(_
\bj_
\bm_
\bp_
\b__
\bb_
\bu_
\bf _
\be_
\bn_
\bv, _
\bi_
\bn_
\bt _
\bv_
\ba_
\bl);
l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bpe
\ber
\brr
\bro
\bor
\br(_
\bv_
\bo_
\bi_
\bd);
D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
The s
\bsi
\big
\bgs
\bse
\bet
\btj
\bjm
\bmp
\bp(), s
\bse
\bet
\btj
\bjm
\bmp
\bp(), and _
\b_s
\bse
\bet
\btj
\bjm
\bmp
\bp() functions save their calling en-
vironment in _
\be_
\bn_
\bv. Each of these functions returns 0.
The corresponding l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() functions restore the environment saved by
their most recent respective invocations of the s
\bse
\bet
\btj
\bjm
\bmp
\bp() function. They
then return so that program execution continues as if the corresponding
invocation of the s
\bse
\bet
\btj
\bjm
\bmp
\bp() call had just returned the value specified by
_
\bv_
\ba_
\bl, instead of 0.
Pairs of calls may be intermixed, i.e. both s
\bsi
\big
\bgs
\bse
\bet
\btj
\bjm
\bmp
\bp() and s
\bsi
\big
\bgl
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp()
and s
\bse
\bet
\btj
\bjm
\bmp
\bp() and l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() combinations may be used in the same program,
however, individual calls may not, e.g. the _
\be_
\bn_
\bv argument to s
\bse
\bet
\btj
\bjm
\bmp
\bp() may
not be passed to s
\bsi
\big
\bgl
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp().
The l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() routines may not be called after the routine which called
the s
\bse
\bet
\btj
\bjm
\bmp
\bp() routines returns.
All accessible objects have values as of the time l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() routine was
called, except that the values of objects of automatic storage invocation
duration that do not have the _
\bv_
\bo_
\bl_
\ba_
\bt_
\bi_
\bl_
\be type and have been changed between
the s
\bse
\bet
\btj
\bjm
\bmp
\bp() invocation and l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() call are indeterminate.
The s
\bse
\bet
\btj
\bjm
\bmp
\bp()/l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() pairs save and restore the signal mask while
_
\b_s
\bse
\bet
\btj
\bjm
\bmp
\bp()/_
\b_l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() pairs save and restore only the register set and the
stack. (See s
\bsi
\big
\bgm
\bma
\bas
\bsk
\bk(_
\b2).)
The s
\bsi
\big
\bgs
\bse
\bet
\btj
\bjm
\bmp
\bp()/s
\bsi
\big
\bgl
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() function pairs save and restore the signal
mask if the argument _
\bs_
\ba_
\bv_
\be_
\bm_
\ba_
\bs_
\bk is non-zero, otherwise only the register
set and the stack are saved.
If the contents of the _
\be_
\bn_
\bv are corrupted, or correspond to an environment
that has already returned, the l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() routine calls the routine
l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bpe
\ber
\brr
\bro
\bor
\br(_
\b3). If l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bpe
\ber
\brr
\bro
\bor
\br() returns the program is aborted (see
abort(2)). The default version of l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bpe
\ber
\brr
\bro
\bor
\br() prints the message
``longjmp botch'' to standard error and returns. User programs wishing
to exit more gracefully should write their own versions of
l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bpe
\ber
\brr
\bro
\bor
\br().
S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
sigaction(2), sigaltstack(2), signal(3)
S
\bST
\bTA
\bAN
\bND
\bDA
\bAR
\bRD
\bDS
\bS
The s
\bse
\bet
\btj
\bjm
\bmp
\bp() and l
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() functions conform to ANSI C X3.159-1989
(``ANSI C ''). The s
\bsi
\big
\bgs
\bse
\bet
\btj
\bjm
\bmp
\bp() and s
\bsi
\big
\bgl
\blo
\bon
\bng
\bgj
\bjm
\bmp
\bp() functions conform to IEEE
Std1003.1-1988 (``POSIX'').
4th Berkeley Distribution June 4, 1993 2