mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 07:49:32 +01:00
* fixed fpsignal for linux/x86_64 and possibly some other platforms as well
(patch by Nikolay Nikolov, mantis #14514) git-svn-id: trunk@13666 -
This commit is contained in:
parent
e8216ff397
commit
1f6b55290e
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9285,6 +9285,7 @@ tests/webtbs/tw14418.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1445.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1450.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1451.pp svneol=native#text/plain
|
||||
tests/webtbs/tw14514.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1470.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1472.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1477.pp svneol=native#text/plain
|
||||
|
||||
@ -13,10 +13,6 @@
|
||||
|
||||
**********************************************************************}
|
||||
|
||||
{$if defined(CPUARM) or defined(CPUX86_64) or defined(CPUSPARC)}
|
||||
{$define RTSIGACTION}
|
||||
{$endif}
|
||||
|
||||
{$I textrec.inc}
|
||||
{$I filerec.inc}
|
||||
|
||||
@ -161,13 +157,6 @@ begin
|
||||
{restart behaviour needs libc}
|
||||
sa.sa_flags :=sa.sa_flags or SA_RESTART;
|
||||
}
|
||||
{$ifdef RTSIGACTION}
|
||||
sa.sa_flags:=SA_SIGINFO
|
||||
{$ifdef cpux86_64}
|
||||
or $4000000
|
||||
{$endif cpux86_64}
|
||||
;
|
||||
{$endif RTSIGACTION}
|
||||
FPSigaction(signum,@sa,@osa);
|
||||
if fpgetErrNo<>0 then
|
||||
fpsignal:=NIL
|
||||
|
||||
38
tests/webtbs/tw14514.pp
Normal file
38
tests/webtbs/tw14514.pp
Normal file
@ -0,0 +1,38 @@
|
||||
{ %target=linux,darwin,solaris,freebsd,haiku,beos }
|
||||
|
||||
program TestSignal;
|
||||
|
||||
{$MODE objfpc}
|
||||
|
||||
uses
|
||||
BaseUnix,
|
||||
sysutils;
|
||||
|
||||
var
|
||||
Ok: Boolean;
|
||||
|
||||
procedure signal_handler(sig: LongInt); cdecl;
|
||||
begin
|
||||
Writeln('4');
|
||||
Ok := True;
|
||||
end;
|
||||
|
||||
var
|
||||
Pid: pid_t;
|
||||
begin
|
||||
Ok := False;
|
||||
Writeln('1');
|
||||
fpsignal(SIGUSR1, @signal_handler);
|
||||
Writeln('2');
|
||||
Pid := fpgetpid;
|
||||
Writeln('3');
|
||||
fpkill(Pid, SIGUSR1);
|
||||
|
||||
sleep(500);
|
||||
if not ok then
|
||||
halt(1);
|
||||
|
||||
Writeln('5');
|
||||
Writeln('done');
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user