I am using fork() and execvp() to spawn a process that must believe it is connected to an interactive terminal for it to function properly.
Once spawned, I want to capture all the output from the process, as well as be able to send input to the process.
I suspect psuedo-ttys may help here. Does anyone have a snippet on how to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…