void FLinuxPlatformProcess::WaitForProc( FProcHandle & ProcessHandle ) { FProcState * ProcInfo = ProcessHandle.GetProcessInfo(); if (ProcInfo) { ProcInfo->Wait(); } }
void FLinuxPlatformProcess::CloseProc(FProcHandle & ProcessHandle) { // dispose of both handle and process info FProcState * ProcInfo = ProcessHandle.GetProcessInfo(); ProcessHandle.Reset(); delete ProcInfo; }
bool FLinuxPlatformProcess::GetProcReturnCode( FProcHandle& ProcHandle, int32* ReturnCode ) { if (IsProcRunning(ProcHandle)) { return false; } FProcState * ProcInfo = ProcHandle.GetProcessInfo(); return ProcInfo ? ProcInfo->GetReturnCode(ReturnCode) : false; }
void FLinuxPlatformProcess::TerminateProc( FProcHandle & ProcessHandle, bool KillTree ) { if (KillTree) { // TODO: enumerate the children STUBBED("FLinuxPlatformProcess::TerminateProc() : Killing a subtree is not implemented yet"); } FProcState * ProcInfo = ProcessHandle.GetProcessInfo(); if (ProcInfo) { int KillResult = kill(ProcInfo->GetProcessId(), SIGTERM); // graceful check(KillResult != -1 || errno != EINVAL); } }
bool FLinuxPlatformProcess::IsProcRunning( FProcHandle & ProcessHandle ) { FProcState * ProcInfo = ProcessHandle.GetProcessInfo(); return ProcInfo ? ProcInfo->IsRunning() : false; }