~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to fpcdocs/olinuxex/ex58.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

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 oldlinux;
 
12
 
 
13
Procedure DoSig(sig : Longint);cdecl;
 
14
 
 
15
begin
 
16
   writeln('Receiving signal: ',sig);
 
17
end;
 
18
 
 
19
begin
 
20
   SigNal(SigUsr1,@DoSig);
 
21
   if LinuxError<>0 then
 
22
     begin
 
23
     writeln('Error: ',linuxerror,'.');
 
24
     halt(1);
 
25
     end;
 
26
   Writeln ('Send USR1 signal or press <ENTER> to exit');
 
27
   readln;
 
28
end.