1
我想將pipe的寫入fd關聯到stdout。如何更改與stdin文件描述符關聯的fd?
int pfds[2];
char buf[30];
if (pipe(pfds) == -1) {
perror("pipe");
exit(1);
}
I want to associate pfd[1] to the stdout of the process.
據我所知,我們可以使用freopen將stdout重定向到文件。我希望能得到類似的東西。
爲什麼不'PFD [1] = stdout',然後呢? –