I'm trying to execve
a process that reads from stdin. I want to prepare stdin with some data so it can execute successfully. How can I do that?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You will need to fork the execve call into a child process and then create a pipe from the parent process to the child's stdin.
Take a look at this link for a detailed example on how to use pipes: http://tldp.org/LDP/lpg/node11.html