[clug-talk] Call a program in C and get the child PID?
me at jonwatson.ca
Mon Sep 19 10:08:15 PDT 2005
At the considerable risk of sounding like an idiot (since I'm not a
developer) can you pipe the PID into a file and then GREP it
Not elegant, but it might work..
> Does anyone know how to call a child program in C and get the PID?
> The system command only returns the exit code, fork copies the
> program and the many version of exec terminate the original program.
> I want to spawn the called program, keep it running and get the PID
> back. I want my C program to start a shell in xterm and then be able
> go and do other things and watch for the xterm shell to be closed by
> go_do("xterm &");
> ChildPid = SomeHowGetTheChildPid();
> Domain match.
> Remove domain from Allow list -->
> Block domain -->
> clug-talk mailing list
> clug-talk at clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the clug-talk