To register a signal handler, use the IDL_SignalRegister() function:

int IDL_SignalRegister(int signo, IDL_SignalHandler_t func, int msg_action)

where:

signo

The numeric value of the signal to register for, as defined in signal.h.

func

The signal handler to be called when the signal specified by signo is raised.

msg_action

One of the IDL_MSG_* action codes for IDL_Message(). If there is an error in registering the signal handler, this action code is passed to IDL_Message() to direct its recovery action. Note that it is incorrect to use any of the message codes that cause IDL_Message() to longjmp() back to the IDL interpreter if your code is running in a context where the IDL interpreter is not active—specifically as part of using Callable IDL.

If func is successfully registered for signo, this routine returns TRUE. Otherwise, FALSE is returned and IDL_Message() is called with msg_action to control its behavior. Note that there are values of msg_action that result in this routine not returning on error. Multiple registration of the same function is allowed, but has no additional effect—the handler will only be called once.