blob: 76ae7bb0153c9c750052456d5100e2238d422821 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
{ %target=linux,darwin,freebsd,netbsd,openbsd,sunos,beos,haiku }
Program Example59;
{ Program to demonstrate the Alarm function. }
Uses BaseUnix;
Procedure AlarmHandler(Sig : cint);cdecl;
begin
Writeln ('Got to alarm handler');
end;
begin
Writeln('Setting alarm handler');
fpSignal(SIGALRM,SignalHandler(@AlarmHandler));
Writeln ('Scheduling Alarm in 10 seconds');
fpAlarm(2);
Writeln ('Pausing');
fpPause;
if fpGetErrno<>ESysEINTR then
halt(1);
Writeln ('Pause returned');
end.
|