[fpc-devel] A bug for fpc 1.9.8?
Zhong Wang
linuxerwang at gmail.com
Wed Mar 2 00:53:03 CET 2005
Hello, everyone
I am using fpc 1.9.8. I find that the function of FPSigaction in
BaseUnix unit dosen't work. I use the example in the document for
FPSigaction, but it can't compile, just give the following error
report:
---->test.pp(25,20) Error: Identifier not found "TSigaction"
The source code are listed as below (from the documents):
---->
Program test;
{ Program to demonstrate the SigAction function.}
{
do a kill -USR1 pid from another terminal to see what happens.
replace pid with the real pid of this program.
You can get this pid by running 'ps'.
}
uses BaseUnix, Unix;
Var
oa,na : PSigActionRec;
Procedure DoSig(sig : cint);cdecl;
begin
writeln('Receiving signal: ',sig);
end;
begin
new(na);
new(oa);
na^.sa_Handler:=TSigaction(@DoSig);
fillchar(na^.Sa_Mask,sizeof(na^.sa_mask),#0);
na^.Sa_Flags:=0;
{$ifdef Linux} // Linux specific
na^.Sa_Restorer:=Nil;
{$endif}
if fpSigAction(SigUsr1,na,oa)<>0 then
begin
writeln('Error: ',fpgeterrno,'.');
halt(1);
end;
Writeln ('Send USR1 signal or press <ENTER> to exit');
readln;
end.
<----
Can anybody would like to help me sovle this problem?
Thank you so much.
More information about the fpc-devel
mailing list