[fpc-pascal]signal handling under linux...

Gene Buckle geneb at deltasoft.com
Fri Jul 27 16:45:43 CEST 2001


Thanks Adam!  This is perfect.

g.


On Fri, 27 Jul 2001, Adam Naumowicz wrote:

> On Fri, 27 Jul 2001, Gene Buckle wrote:
> 
> > Is there a known method for processing signals such as SIGTERM and
> > SIGQUIT?  I need to be able to execute some code when either one of those
> > signals are sent to my application.
> 
> To install your own signal handler use the Signal function in 'linux'
> unit like that:
> 
> var NewSignal, OldSigInt : SignalHandler;
> 
> procedure CatchSignal(aSig : Integer);cdecl;
> begin
>   case aSig of
>     SIGQUIT : do_something1;
>     SIGTERM : do_something2;
>   end;
> end;
> 
> ....
> 
> NewSignal:=SignalHandler(CatchSignal);
> OldSigInt:=Signal(SIDQUIT,NewSignal);
> OldSigInt:=Signal(SIGTERM,NewSignal);
> 
> Regards,
> Adam Naumowicz
> 
> --------------------------------------
> WWW: http://math.uwb.edu.pl/~adamn/
> --------------------------------------
> 
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> 
> 





More information about the fpc-pascal mailing list