Guardian Procedure Calls Reference Manual
SETJMP_ Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameter
Considerations
Example
Related Programming Manual
Summary
The SETJMP_procedure saves process context in a jump buffer. This context is used when a nonlocal
goto is performed by a corresponding call to the LONGJMP_ procedure.
Syntax for C Programmers
#include <setjmp.h>
jmp_buf env;
int setjmp ( jmp_buf env );
Syntax for TAL Programmers
?SOURCE $SYSTEM.ZGUARD.HSETJMP
retval := SETJMP_ ( env ); ! o
Parameter
env
output
INT .EXT:ref:(JMP_BUF_TEMPLATE)
specifies the address of a previously allocated jump buffer in which the process context of the
caller is returned. The jump buffer is allocated using the JMP_BUF_DEF DEFINE.
Returned Value
INT(32)
Outcome of the call:
SETJMP_ procedure was called directly.0D
SETJMP_ procedure is returning as a result of a call to the LONGJMP_ procedure. The returned value is
specified by LONGJMP_.
<>0D
Considerations
• SETJMP_ is the TAL or pTAL procedure name for the C setjmp() function. The C setjmp()
function complies with the POSIX.1 standard.
• Calling SETJMP_ is the functional equivalent of calling the SIGSETJMP_ procedure with mask
= 0D.
• You can allocate the jump buffer for SETJMP_ using the JMP_BUF_DEF DEFINE as follows:
JMP_BUF_DEF ( env );
SETJMP_ Procedure 1313