OBOE  0.1
AccpmSignal.h
Go to the documentation of this file.
00001 // Copyright (c) 2004-2007 University of Geneva, HEC, Logilab
00002 //
00003 // OBOE is published under the Common Public License.
00004 //
00005 // Authors :
00006 // The OBOE team
00007 //
00008 
00009 #ifndef ACCPM_SIGNAL_H
00010 #define ACCPM_SIGNAL_H
00011 
00012 #include <fenv.h>
00013 #include <signal.h>
00014 
00015 static void 
00016 signalHandler(int signum)
00017 {
00018   std::cout << "Signal Handler called with signal " 
00019         << signum << std::endl;
00020   //longjmp(context, signum);
00021   exit(0);
00022 }
00023 
00024 void
00025 AccpmInstallSignalHandler()
00026 {
00027   feenableexcept(FE_UNDERFLOW);
00028   signal(SIGFPE, signalHandler);
00029 }
00030 
00031 #endif