distinguish stdout from stderr on pipe
So, related to the link above, I have a child who is executing tail
and parent is reading its out put via a pipe
.
dup2(pipefd[1], STDOUT_FILENO);
dup2(pipefd[1], STDERR_FILENO);
My question is, if somehow tail
fails, what happens to the pipe from which I am reading? Do I get anything on stderr
? Does tail
terminate itself? or it may hang in there as defunct
?