VMS Help
CRTL, VAXC$ESTABLISH
*Conan The Librarian
|
Used for establishing an OpenVMS exception handler for a
particular routine. This function establishes a special Compaq 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));
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.
VAXC$ESTABLISH must be used in place of LIB$ESTABLISH when
programs use the Compaq C RTL routines setjmp or longjmp. See
setjmp and longjmp, or sigsetjmp and siglongjmp.
You can only invoke the VAXC$ESTABLISH function from an Compaq C
for OpenVMS function, because it relies on the allocation of data
space on the run-time stack by the Compaq C compiler. Calling
the OpenVMS system library routine LIB$ESTABLISH directly from an
Compaq 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 the "Error and Signal Handling"
chapter of the HP C RTL Reference Manual. 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
On OpenVMS Alpha systems, VAXC$ESTABLISH is implemented as a
compiler built-in function, not as an Compaq C RTL function.
(Alpha only)