I do want to kill a process I have a pid of, so my code is the following:
pid_t pid = 28880;
boost::process::child process { pid };
std::cout << "Running: " << process.running() << "\n";
process.terminate();
I noticed though that running() always returns false (no matter what pid I take) and based on the source code then terminate isn't even called.
Digging a little bit deeper it seem to be the linux function waitpid is called. And it always returns -1 (which means some error has occured, rather than 0, which would mean: Yes the process is still running).
WIFSIGNALED return 1 and WTERMSIG returns 5.
Am I doing something wrong here?
