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

Roy Souther roy at silicontao.com
Tue Sep 20 10:45:08 PDT 2005


I am working on a program that talks on the serial port. I want to add a
feature to let the user see if data is coming in the port.
I have not figured out all the steps yet but it will do something like
this.

go_do("xterm &");
get the PID of xterm and use it to find the tty it opened, something
like ttyp4

go_do("cat /dev/ttyUSB0 | hexdump -C > /dev/ttyp4 &");
get the PID of the cat

go do other things in the program
watch the PID of xterm. When xterm is no longer running go kill the cat

With this the user can click a button to get a box that will show what
the serial port is receiving.

Royce Souther
www.SiliconTao.com
Let Open Source help your business move beyond.

For security this message is digitally authenticated by GnuPG.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : /pipermail/clug-talk_clug.ca/attachments/20050920/2417f62c/attachment.bin


More information about the clug-talk mailing list