Guest User

Untitled

a guest
Jul 17th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. --
  2. --
  3. function C_Fork return C.int;
  4. pragma Import (C, C_Fork, "fork");
  5.  
  6. function Fork return Integer is
  7. ReturnVAR : Integer;
  8. Fork_Failed : exception;
  9. begin
  10. ReturnVAR := Integer(C_Fork);
  11. if ReturnVAR = -1 then
  12. raise Fork_Failed;
  13. end if;
  14. return ReturnVAR;
  15. exception
  16. when Fork_Failed =>
  17. Text_IO.Put_Line (Text_IO.Standard_Error,
  18. "Fork call failed.");
  19. return ReturnVAR;
  20. when others =>
  21. Text_IO.Put_Line (Text_IO.Standard_Error,
  22. "Exception raised in Fork call.");
  23. raise;
  24. end Fork;
Add Comment
Please, Sign In to add comment