DaanDeMeyer / reproc

A cross-platform (C99/C++11) process library
MIT License
552 stars 65 forks source link

reproc++: get process status #39

Closed mipac closed 4 years ago

mipac commented 4 years ago

I get process status with wait while running I have -110 (seems to be -ETIMEDOUT) If I kill the process from a terminal, I get 137 with kill -9, 133 with -5 in both case the error_code message is : success

How can I "translate" these status, I can't find a function to convert status to string, and a table to build a switch case? When process die, cause kill in my case, is it ok if the error_code is (0:success)?

with my best regards

mipac commented 4 years ago

oups ... status from waitpid could help someone: I have to parse with W macros (WSTOPSIG, WEXITSTATUS and so on ... cf man waitpid)

perhaps a "status converter" could be cool ;) , especially for portability!

sorry for noise, and thx a lot for that good lib hope to see it integrated in c++23 ;)