

longjmp()                General Function               longjmp()




Return from a non-local goto

#include <setjmp.h>
iinntt lloonnggjjmmpp(_e_n_v, _r_v_a_l) jjmmpp_bbuuff _e_n_v; iinntt _r_v_a_l;

The function call is the only mechanism that C provides to trans-
fer control between  functions.  This mechanism is inadequate for
some purposes,  such as handling unexpected  errors or interrupts
at  lower levels  of  a program.   To answer  this need,  lloonnggjjmmpp
provides a non-local _g_o_t_o.

lloonnggjjmmpp restores an environment that had been saved by a previous
call to  the function sseettjjmmpp.   It returns the value  _r_v_a_l to the
caller of  sseettjjmmpp, just as if the sseettjjmmpp  call had just returned.
Note that  lloonnggjjmmpp must not restore the  environment of a routine
that has  already returned.  The type  declaration for jjmmpp_bbuuff is
in the header  file sseettjjmmpp.hh.  The environment saved includes the
program counter, stack  pointer, and stack frame.  These routines
do not restore register variables in the environment returned.

***** Example *****

For an example of this function, see the entry for longjmp.

***** See Also *****

general functions, setjmp()

***** Notes *****

Programmers should  note that many user-level  routines cannot be
interrupted and reentered  safely.  For that reason, improper use
of longjmp  and setjmp can  result in the  creation of mysterious
and irreproducible bugs.  Do not attempt to use longjmp within an
exception handler.





















COHERENT Lexicon                                           Page 1


