longjmp

###

###

###

###

###

###

###

    LONGJMP(3)              Library functions              LONGJMP(3)

    NAME
           longjmp - non-local jump to a saved stack context

    SYNOPSIS
           #include <setjmp.h>

           void longjmp(jmp_buf env, int val);

    DESCRIPTION
           longjmp() and setjmp(3) are useful for dealing with errors
           and interrupts encountered in a low-level subroutine of  a
           program.   longjmp() restores the environment saved by the
           last call of setjmp() with the corresponding env argument.
           After  longjmp() is completed, program execution continues
           as if the corresponding call of setjmp() had just returned
           the  value  val.  longjmp() cannot cause 0 to be returned.
           If longjmp is invoked with a second argument of 0, 1  will
           be returned instead.

    RETURN VALUE
           This function never returns.

    CONFORMING TO
           POSIX

    NOTES
           POSIX  does  not  specify  if  the  signal context will be
           restored or not.  If  you  want  to  save  restore  signal
           masks,  use siglongjmp(3) longjmp() makes programs hard to
           understand  and  maintain.   If  possible  an  alternative
           should be used.

### SEE ALSO

setjmp, sigsetjmp, siglongjmp,

                            November 25, 1994                       1

Top | Master Index | Keywords | Functions

This manual page was brought to you by mjl_man V-2.0