ex75.pp 382 B

123456789101112131415161718192021
  1. Program Example75;
  2. { Program to demonstrate the setsid function. }
  3. Uses BaseUnix;
  4. Var
  5. Pid : pid_t;
  6. begin
  7. Writeln('Current process group: ',fpgetpgrp);
  8. // Force non-process group leader.
  9. Pid:=fpFork;
  10. if (Pid=0) then
  11. begin
  12. Writeln('SetSid returned : ',FpSetSid);
  13. Writeln('New process group: ',fpgetpgrp);
  14. end
  15. else
  16. Writeln('Child PID :',Pid);
  17. end.