implementation. Instead, allocate two ptys and connect one to standard
input and the other to standard output and standard error of the child
process. After the first data is received from the slave, close the
master connected to standard input; that will generate an EOF on input
to the child process. This ends up being much cleaner than looping and
waiting to send the EOF character to the child process.