I am reading the output of an external command with the usual sequence
of pipe[2], fork, dup2, execv, etc. The parent process currently
reads the child's output from the pipe and then calls waitpid. Pretty
straightforward.
I'm trying to refactor the code into more digestible chunks, and I'd
like to separate the "lower level" process management stuff into its
own function. This would mean that the parent process would call
waitpid before reading the child's output from the pipe.
This seems to work fine in my initial smoke testing (on Fedora 19), but
I have a slightly uncomfortable feeling that the fate of any "in flight"
data in the pipe may not be guaranteed in this situation. Thus far I
haven't been able to come up with search terms that shed any light on
the question.
Am I just being paranoid (or am I not being paranoid enough)?
Thanks!
--
========================================================================
Ian Pilcher
arequ...@gmail.com
Sometimes there's nothing left to do but crash and burn...or die trying.
========================================================================