Guardian Procedure Calls Reference Manual
LONGJMP_ Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Considerations
Example
Related Programming Manual
Summary
The LONGJMP_ procedure performs a nonlocal goto. It restores the state of the calling process
with context saved in a jump buffer by the SETJMP_ procedure. Control returns to the location of
the corresponding SETJMP_ procedure call.
Syntax for C Programmers
#include <setjmp.h>
jmp_buf env;
void longjmp ( jmp_buf env
,int value );
Syntax for TAL Programmers
?SOURCE $SYSTEM.ZGUARD.HSETJMP
LONGJMP_ ( env ! i
,value ); ! i
Parameters
env
input
INT .EXT:ref:(JMP_BUF_TEMPLATE)
indicates the address of a jump buffer containing the process context to be restored.
value
input
INT(32)
specifies the value to be returned at the destination of the long jump; that is, at the location of
the corresponding SETJMP_ call. If this value is set to 0D, then 1D is returned; otherwise value
is returned.
Considerations
• LONGJMP_ is the TAL or pTAL procedure name for the C longjmp() function. The C
longjmp() function complies with the POSIX.1 standard.
• Do not call LONGJMP_ with a jump buffer that contains the signal mask that was set up by a
call to the SIGSETJMP_ procedure, or the system will raise a SIGABRT signal.
LONGJMP_ can be used with a jump buffer initialized by the SIGSETJMP_ procedure only if
the call to SIGSETJMP_ does not save the signal mask.
LONGJMP_ Procedure 779