mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 11:31:53 +01:00
add is_running support
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user