add is_running support

This commit is contained in:
Yuval Kashtan
2014-08-11 09:10:48 +03:00
parent 7a008cbc76
commit af44951e77
14 changed files with 126 additions and 0 deletions

View File

@@ -220,7 +220,23 @@ void ProcessImpl::killImpl(PIDImpl pid)
}
}
bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle)
{
return isRunningImpl(handle.id());
}
bool ProcessImpl::isRunningImpl(PIDImpl pid)
{
if (kill(pid, 0) == 0)
{
return true;
}
else
{
return false;
}
}
void ProcessImpl::requestTerminationImpl(PIDImpl pid)
{
if (kill(pid, SIGINT) != 0)