Quote:>In my C program, I create a child process which needs to get the control
>of the terminal from the parent, and return control to the parent when it
>exits. When I say control what I mean is that I would like the child
>process to be able to take input from stdin. Can someone tell me if it is
>possible and if possible how it may be done?
A child process inherits the open files from its parent, so it can just
start reading. What you need to do is prevent them from both trying to
read at the same time. In your case, the parent can do this simply by not
trying to read from stdin until the child exits. In a more complex
situation, where you want control to go back and forth between the parent
and child, you'll need a separate communication mechanism between the two
processes (e.g. a pair of pipes) so that they can let each other know when
they're done using stdin.
System Manager, Thinking Machines Corp.