program TestSignals;
{$APPTYPE CONSOLE}
uses Libc;
var
bTerminate: Boolean;
procedure SignalProc(SigNum: Integer); cdecl;
begin
case SigNum of
SIGQUIT:
begin
WriteLn('signal SIGQUIT');
bTerminate := true;
end;
SIGUSR1: WriteLn('signal SIGUSR1');
else
WriteLn('not handled signal');
end;
signal(SigNum, SignalProc);
end;
begin
bTerminate := false;
signal(SIGQUIT, SignalProc);
signal(SIGUSR1, SignalProc);
repeat
sleep(1);
until bTerminate;
end.
THIS BLOG IS AIMED AT DELPHI, C#.NET, ASP.NET PROFESSIONALS WHO ARE NEW TO THE COMMUNITY AND LOOKING FOR TIPS AND TRICKS. IT WILL HOPEFULLY SHOW YOU HOW AND WHERE TO GET HELP BUT WILL NOT TELL YOU HOW TO DO YOUR JOB - THAT BIT IS UP TO YOU.
Monday, June 25, 2007
How to catch kernel-signals in Kylix?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment