[clug-talk] Call a program in C and get the child PID?

Jon me at jonwatson.ca
Mon Sep 19 10:08:13 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

> user. 


> go_do("xterm &"); 

> ChildPid = SomeHowGetTheChildPid(); 



> Domain match. 

> Remove domain from Allow list --> 


> Block domain --> 



> _______________________________________________ 

> clug-talk mailing list 

> clug-talk at clug.ca 

> http://clug.ca/mailman/listinfo/clug-talk_clug.ca 

> Mailing List Guidelines (http://clug.ca/ml_guidelines.php) 

> **Please remove these lines when replying 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/clug-talk_clug.ca/attachments/20050919/2fb239fb/attachment-0001.htm

More information about the clug-talk mailing list