Say I have two programs X and Y asking for input from stdin. X and Y are run using fork() followed by execve() from a third from say A.
What is happening is X is scheduled first. When X reaches the scanf statement, Y gets scheduled and X never gets an input. How do I take care of it?
Have
Amediate the input forXandY.Acan create a pipe to and from each child process. It can read a prompt from a pipe, write the prompt to standard output, read the response from standard input, and write the response to the pipe for the child process.