--  forkdemo2.adb
--    Shows how child processes pick up at the return from fork() and
--    can execute any code they like, even fork().  Predict the number
--    of lines of output.

with Ada.Text_IO, Interfaces.C.Strings;

with Fork, Get_Process_ID;

procedure Fork_Demo_2 is
   package int_Text_IO is new Ada.Text_IO.Integer_IO (Interfaces.C.int);
   use Ada.Text_IO, int_Text_IO;
   Dummy : Interfaces.C.int;
begin
   Put ("Before: My process ID is ");
   Put (Get_Process_ID, Width => 0);
   New_Line;

   Dummy := Fork;
   Dummy := Fork;
   Dummy := Fork;

   Put ("After: My process ID is ");
   Put (Get_Process_ID, Width => 0);
   New_Line;
end Fork_Demo_2;

