Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このような電話があります。
int fd[2]; pipe(fd)
その後
dup2(fd[WRITE],STDOUT_FILENO)
dup呼び出しを使用して1と2の両方をfd[WRITE]に複製する方法はありますか?
stderrに対してこの操作を繰り返すだけです。
dup2(fd[WRITE], STDOUT_FILENO); dup2(fd[WRITE], STDERR_FILENO);