[net.unix-wizards] controlling standard input in a forked process

mark.umcp-cs@UDel-Relay (03/31/83)

From:  Mark Weiser <mark.umcp-cs@UDel-Relay>

Date: 28 Mar 1983 0340-PST
Just fork off the child with a pipe connected to standard input, 
and the other end of the pipe under the control of the parent.
Use dup2() to move the pipe file descripter to 0 (which is standard in)
after the fork but before the exec.

Make sure to close all unused descripters in each process to make
things clean.