9 static constexpr int READ = 0;
10 static constexpr int WRITE = 1;
14 if (pipe(PipeIn) == -1 || pipe(PipeOut) == -1 || pipe(PipeErr) == -1)
15 throw std::system_error(errno, std::generic_category());
24 dup2(PipeIn[READ], STDIN_FILENO);
25 dup2(PipeOut[WRITE], STDOUT_FILENO);
26 dup2(PipeErr[WRITE], STDERR_FILENO);
28 close(PipeOut[WRITE]);
29 close(PipeErr[WRITE]);
35 close(PipeOut[WRITE]);
36 close(PipeErr[WRITE]);
39 throw std::system_error(errno, std::generic_category());