~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to docs/bunixex/ex58.pp

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Program example58;
 
2
 
 
3
{ Program to demonstrate the Signal function.}
 
4
 
 
5
{
 
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'.
 
9
}
 
10
 
 
11
uses BaseUnix;
 
12
 
 
13
Procedure DoSig(sig : cint);cdecl;
 
14
 
 
15
begin
 
16
   writeln('Receiving signal: ',sig);
 
17
end;
 
18
 
 
19
begin
 
20
   if fpSignal(SigUsr1,SignalHandler(@DoSig))=signalhandler(SIG_ERR) then
 
21
     begin
 
22
     writeln('Error: ',fpGetErrno,'.');
 
23
     halt(1);
 
24
     end;
 
25
   Writeln ('Send USR1 signal or press <ENTER> to exit');
 
26
   readln;
 
27
end.