2015-03-23 21:03:14 +00:00
|
|
|
/*
|
2015-02-26 15:02:31 +00:00
|
|
|
PURPOSE: (Floating point exception handler)
|
|
|
|
|
|
|
|
PROGRAMMERS: (((Robert W. Bailey) (LinCom) (April 1992) (--) (Realtime)))
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
2015-03-23 21:03:14 +00:00
|
|
|
/*
|
|
|
|
* FPE specific headers
|
2015-02-26 15:02:31 +00:00
|
|
|
*/
|
|
|
|
#ifdef __linux
|
|
|
|
#include <fenv.h>
|
|
|
|
#endif
|
|
|
|
|
2015-06-01 15:28:29 +00:00
|
|
|
#include "trick/Executive.hh"
|
|
|
|
#include "trick/exec_proto.hh"
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @relates Trick::Executive
|
|
|
|
* C binded function to handle the SIGFPE signal. The handler prints which type of
|
|
|
|
* floating point error has occured and calls exec_terminate()
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
#if (__APPLE__ | __CYGWIN__ | __INTERIX )
|
|
|
|
void fpe_sig_handler(int sig __attribute__ ((unused)) )
|
|
|
|
#else
|
|
|
|
void fpe_sig_handler(int sig __attribute__ ((unused)), siginfo_t * sip __attribute__ ((unused)), void *uap __attribute__ ((unused)))
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
|
|
|
|
Trick::Executive * E = exec_get_exec_cpp();
|
|
|
|
|
|
|
|
#if __APPLE__
|
|
|
|
siginfo_t * sip = NULL ;
|
|
|
|
#endif
|
|
|
|
|
2015-03-23 21:03:14 +00:00
|
|
|
E->fpe_handler(sip) ;
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
}
|