And... no. You cannot repeat the read, it blocks forever on EOF (weird it works on real pipes, but not this kind). Instead I wait for the process to finish (waitpid), and only then read the data, that should be enough to guarantee we read everything.