I suppose this will work if you fcntl it to a non-blocking read. I suppose this isn't treated as an EOF as the process is still somewhat lingering (zombie). It might also work to move the read after the waitpid(), I haven't tried that.