[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
out?

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
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 

> user. 

> 

> go_do("xterm &"); 

> ChildPid = SomeHowGetTheChildPid(); 

> 

> 

> Domain match. 

> Remove domain from Allow list --> 

>
https://www.vqme.com/pk/eh?op=remove_domain&Domain=clug.ca&VU=HqIXF6rk+PpDI0Rq/fWFgg


> Block domain --> 

>
https://www.vqme.com/pk/eh?op=block_domain&Domain=clug.ca&VU=HqIXF6rk+PpDI0Rq/fWFgg


> 

> _______________________________________________ 

> 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