Both processes have their stdin
connected to the terminal (or whatever the original process's stdin
was connected to). This doesn't change when you call execv
. If both processes try to read from stdin
at the same time, it's unpredictable which one will get the input.
If you want to disconnect the child process from the terminal, you should call setsid()
before calling execv
to put it in its own session and remove its controlling terminal.