LONGJMP(3F) — FORTRAN LIBRARY ROUTINES
NAME
longjmp, isetjmp − longjmp returns to the location set by isetjmp
SYNOPSIS
Usage: isetjmp
integer env(12)
common /jmpblk/ env
j = isetjmp( env )
Usage: longjmp
integer env(12)
common /jmpblk/ env
call longjmp(env,ival)
DESCRIPTION
The isetjmp and longjmp routines are used to deal with errors and interrupts encountered in a low-level routine of a program. These routines should be used only as a last resort. They require discipline. They are not portable. Read the man page setjmp (3V) for bugs and other details. isetjmp saves the stack environment in env. It also saves the register environment. longjmp restores the environment saved by the last call to isetjmp and returns in such a way that execution continues as if the call to isetjmp had just returned the value ival. The integer expression ival returned from isetjmp is zero if longjmp is not called, and it is nonzero if longjmp is called. Example: Code fragment using isetjmp and longjmp.
integer env(12)
common /jmpblk/ env
j = isetjmp( env ) ! <-- isetjmp
if ( j .eq. 0 ) then
call sbrtnA
else
call error_processor
end if
end
subroutine sbrtnA
integer env(12)
common /jmpblk/ env
call longjmp( env, ival ) ! <-- longjmp
return
end
NOTE
You must invoke isetjmp before calling longjmp(). The argument to isetjmp must be a 12 integer array. You must pass the env variable from the routine that calls isetjmp to the routine that calls longjmp, either by common or as an argument. longjmp() attempts to clean up the stack.
longjmp() must be called from a lower call-level than isetjmp(). Passing isetjmp as an argument that is a procedure name does not work.
BUGS
See setjmp(3V).
FILES
libF77.a
SEE ALSO
setjmp(3C), Solaris 2.x
setjmp(3V), Solaris 1.x
For the C version of longjmp, use: man -M /usr/man longjmp
For the C version of isetjmp, use: man -M /usr/man isetjmp
Sun Release 4.1 — Last change: 19 April 1994