int MLSetSignalHandler(MLENV env, int s, void *sa) installs the Unix signal handler detailed in the object sa for signal s in the MathLink library signal-handling mechanism.
MLSetSignalHandler() does nothing on Microsoft Windows.
sa is a pointer to a Unix sigaction struct. See the header file signal.h on most Unix and Unix-like systems for details regarding the sigaction structure.
MLSetSignalHandler() returns MLEOK if no error occurs and one of the other error codes as listed in mathlink.h in the event of an error.
MLSetSignalHandler() is declared in the MathLink header file mathlink.h.
/* install app_signal_handler for SIGHUP */ err = MLSetSignalHandler(ep, SIGHUP, (void *)&sa); if(err MLEOK) { /* unable to set the signal handler in ep */ } }