--  forkdemo1.adb
--    Shows how fork creates two processes, distinguishable by the
--    different return values from fork().

with Ada.Text_IO, Interfaces.C;

with Fork, Get_Process_ID;

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

   Returned_From_Fork := Fork;

   delay 1.0;
   Put ("After: My process ID is ");
   Put (Get_Process_ID, Width => 0);
   Put (", fork() said ");
   Put (Returned_From_Fork, Width => 0);
   New_Line;
end Fork_Demo_1;

