MLSetSignalHandlerFromFunction (C Function)

MLSetSignalHandlerFromFunction has been replaced by WSSetSignalHandlerFromFunction.

installs the Unix signal handler pointed to by sf for signal s in the MathLink library signal-handling mechanism.

Details

  • MLSetSignalHandlerFromFunction() does nothing on Microsoft Windows.
  • sf is a pointer to a signal-handling function of type void (*func)(int). See the header file signal.h on most Unix and Unix-like systems for further details.
  • MLSetSignalHandlerFromFunction() returns MLEOK if no error occurs and one of the other error codes as listed in mathlink.h in the event of an error.
  • MLSetSignalHandlerFromFunction() is declared in the MathLink header file mathlink.h.

Examples

Basic Examples  (1)

#include <signal.h>
#include "mathlink.h"

void h(int signum)
{
    /* ... */
}

/* set a SIGHUP signal handler in the MathLink environment */

void f(MLENV ep)
{
    int err;
    err = MLSetSignalHandlerFromFunction(ep, SIGHUP, (void *)h);
    if(err != MLEOK)
        { /* unable to set the signal handler in ep */ }
}