Может ли кто-нибудь сказать мне, как перехватить вывод утилиты timeout
.Как я сделал снимок, как показано ниже, но это не так, как ожидалось.
std::string syscommand = "timeout -s KILL 1s command";
int res = system(syscommand.c_str());
std::cout << res;
Поскольку я прошел через какой-то пост и обнаружил, что вывод должен быть как ниже.
124 if command times out
125 if timeout itself fails
126 if command is found but cannot be invoked
127 if command cannot be found
137 if command is sent the KILL(9) signal (128+9)
the exit status of command otherwise
икак напечатать ошибку тоже нет.