VAXC$ESTABLISH

Used for establishing an OpenVMS exception handler for a particular routine. This function establishes a special DEC C RTL exception handler in the routine that called it. This special handler catches all RTL-related exceptions that occur in later routines, and passes on all other exceptions to your handler.

Format

#include  <signal.h>

void VAXC$ESTABLISH  (unsigned int
                     (*exception_handler)(void
                     *sigarr, void *mecharr));

Arguments

exception_handler
The name of the function that you want to establish as an OpenVMS exception handler. You pass a pointer to this function as the parameter to VAXC$ESTABLISH.
sigarr
A pointer to the signal array.
mecharr
A pointer to the mechanism array.

Description

VAXC$ESTABLISH must be used in place of LIB$ESTABLISH when programs use the DEC C RTL routines setjmp or longjmp. See setjmp and longjmp, or sigsetjmp and siglongjmp in this section.

You can only invoke the VAXC$ESTABLISH function from a DEC C for OpenVMS function, because it relies on the allocation of data space on the run-time stack by the DEC C compiler. Calling the OpenVMS system library routine LIB$ESTABLISH directly from a DEC C function results in undefined behavior from the setjmp and longjmp functions.

To cause an OpenVMS exception to generate a UNIX style signal, user exception handlers must return SS$_RESIGNAL upon receiving any exception that they do not want to handle. Returning SS$_NORMAL prevents the generation of a UNIX style signal. UNIX signals are generated as if by an exception handler in the stack frame of the main C program. Not all OpenVMS exceptions correspond to UNIX signals. See Chapter 4 for more information on the interaction of OpenVMS exceptions and UNIX style signals.

Calling VAXC$ESTABLISH with an argument of NULL cancels an existing handler in that routine.


Notes


Previous Page | Next Page | Table of Contents | Index