For all settable signals see:
http://root.cern.ch/root/html/TSysEvtHandler.h
(still situation before above changes).
Have a look in http://root.cern.ch/root/html/src/TRint.cxx.html
to see how a interrupt handler can be implemented.
Cheers, Fons.
Cyril Broude wrote:
> 
> Dear RootTalk
> 
>  I am trying to trap SIGTERM using a class I derive from TSignalHandler.
> I assumed it would be very much like what I've done succesfully with
> TTimer.
> 
> Immediately after the instance is created, I get the following message:
> 
> SysError in <UnixSignal>: sigaction (Success)
> 
> My code is:
> 
> /////////////////////////////////////////////
> #include "TSystem.h"
> #include "TSysEvtHandler.h"
> #include <signal.h>
> class SignalTrap: public TSignalHandler
> {
>   private:
>     ESignals signal;
> 
>   public:
>     SignalTrap(ESignals sig);
>     Bool_t Notify();
>     ESignals GetMySignal()
>     {
>       return(signal);
>     }
> };
> 
> SignalTrap::SignalTrap(ESignals sig): TSignalHandler(sig)
> {
>   signal=sig;
>   gSystem->AddSignalHandler(this);
> }
> 
> Bool_t SignalTrap::Notify()
> {
>   printf("trapped a signal\n");
>   return kTRUE;
> }
> //////////////////////////////////////
> 
> and I instantiate with:
> 
>   SignalTrap *sigtrap = new SignalTrap((ESignals)SIGTERM);
> 
> Calls to GetMySignal and GetSignal return 15, as expected. Sending
> kill or kill -s 15 to the process, I dont see that Notify() has been
> entered.
> 
> Regards,
> 
> Cyril
-- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland Phone: +41 22 7679248 E-Mail: Fons.Rademakers@cern.ch Fax: +41 22 7677910