[clug-talk] Call a program in C and get the child PID?
lewkor at telus.net
Mon Sep 19 12:09:20 PDT 2005
On September 19, 2005 10:31 am, Roy Souther wrote:
> 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 running
> 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 to
> go and do other things and watch for the xterm shell to be closed by the
> go_do("xterm &");
> ChildPid = SomeHowGetTheChildPid();
Roy, I am curious what you are doing. If you can, can you tell us what you
are up to?
More information about the clug-talk