3
{ Program to demonstrate the SigAction function.}
6
do a kill -USR1 pid from another terminal to see what happens.
7
replace pid with the real pid of this program.
8
You can get this pid by running 'ps'.
14
oa,na : PSigActionRec;
16
Procedure DoSig(sig : cint);cdecl;
19
writeln('Receiving signal: ',sig);
25
na^.sa_Handler:=SigActionHandler(@DoSig);
26
fillchar(na^.Sa_Mask,sizeof(na^.sa_mask),#0);
28
{$ifdef Linux} // Linux specific
31
if fpSigAction(SigUsr1,na,oa)<>0 then
33
writeln('Error: ',fpgeterrno,'.');
36
Writeln ('Send USR1 signal or press <ENTER> to exit');