Can popen() make bidirectional pipes like pipe() + fork()?

后端 未结 6 1555
温柔的废话
温柔的废话 2020-11-28 07:29

I\'m implementing piping on a simulated file system in C++ (with mostly C). It needs to run commands in the host shell but perform the piping itself on the simulated file s

6条回答
  •  清歌不尽
    2020-11-28 07:39

    No need to create two pipes and waste a filedescriptor in each process. Just use a socket instead. https://stackoverflow.com/a/25177958/894520

提交回复
热议问题