MLSetSignalHandlerFromFunction()


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

DetailsDetails

  • 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.

ExamplesExamplesopen allclose all

Basic Examples (1)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 */ }
}
New to Mathematica? Find your learning path »
Have a question? Ask support »