I'm writing a process manager in Ada, for Linux. I'm using GNAT.OS_Lib to spawn processes:
Pid := GNAT.OS_Lib.Non_Blocking_Spawn(
Program_Name => Program,
Args => Arguments
);
This gets me back the PID as a Process_Id, an OS_Lib private type. I would like to be able to store this PID in a file as an integer, for compatibility with other, non-Ada code, and then re-load it later from that file and use it from within Ada to kill the process, check its status, etc.
OS_Lib provides a Pid_To_Integer function, but not the inverse.
Perhaps I need a different library? As far as I can tell, there are no current Ada POSIX libraries. Should I write one myself? I only need support for like three POSIX calls. I'm open to all suggestions.