isetjmp man page on Solaris

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
Solaris logo
[printable version]

LONGJMP(3F)							   LONGJMP(3F)

NAME
       longjmp, isetjmp - longjmp returns to the location set by isetjmp

SYNOPSIS
       Usage: isetjmp:

	   integer*4  env(12)
	   common /jmpblk/ env
	   j = isetjmp( env )

       Usage: longjmp:

	   integer*4  env(12)
	   common /jmpblk/ env
	   call longjmp(env,ival)

       When  compiling	for 64-bit environments, the 12-element array env used
       by these routines must be declared INTEGER*8.

DESCRIPTION
       The isetjmp and longjmp routines are  used  to  deal  with  errors  and
       interrupts encountered in a low-level routine of a program.  These rou‐
       tines should be used only as a last resort, as they require  discipline
       and  are not portable.  Read the man page setjmp(3c) 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 nonzero if longjmp is called.

       Example: Code fragment using isetjmp and longjmp:
	    integer*4  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*4  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(3c).

FILES
       libC.a

SEE ALSO
       setjmp(3C).

				  2002/11/27			   LONGJMP(3F)
[top]

List of man pages available for Solaris

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net