2.9BSD/usr/man/cat3/setjmp.3

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


SETJMP(3)           UNIX Programmer's Manual            SETJMP(3)

NAME
     setjmp, longjmp - non-local goto

SYNOPSIS
     #include <setjmp.h>

     setjmp(env)
     jmp_buf env;

     longjmp(env, val)
     jmp_buf env;

DESCRIPTION
     These routines are useful for dealing with errors and inter-
     rupts encountered in a low-level subroutine of a program.

     _S_e_t_j_m_p saves its stack environment in _e_n_v for later use by
     _l_o_n_g_j_m_p. It returns value 0.

     _L_o_n_g_j_m_p restores the environment saved by the last call of
     _s_e_t_j_m_p.  It then returns in such a way that execution con-
     tinues as if the call of _s_e_t_j_m_p had just returned the value
     _v_a_l to the function that invoked _s_e_t_j_m_p, which must not
     itself have returned in the interim.  All accessible data
     have values as of the time _l_o_n_g_j_m_p was called.

SEE ALSO
     signal(2)

BUGS
     The values of the register variables are not saved.  Thus,
     the function that calls _s_e_t_j_m_p should not use register
     declarations for variables that might be accessed after the
     _l_o_n_g_j_m_p.

Printed 7/22/83                                                 1