[ Attached Message ]
From: | |
To: | |
Date: | Wed, 13 Sep 2000 12:07:31 +0400 |
Local: | Wed, Sep 13 2000 4:07 am |
Subject: | fork() and system() |
I'm writing a program which reads from the serial port and then
executes an external program (a perl script) using system...
everything works Fine... but the thing is, that I don't want the main
program to wait for the process to finish with waitpid(pid,&status,0) I
want my c prog to execute but as soon as system my program fork()s for
system(), return to the reading state, regardless of how much time does
it take to perform the external execution..... if I remove the waitpid()
line I get a zombie process for every system call I make... do I have to
use a threads library or something similar?? can I do it with fork???
the reason I care about this is because I might miss a read if the
external program takes too long.. so I basically want to be reading from
the serial port the most I can..
Thankx