Lines Matching refs:handle

25 bool WaitpidWithTimeout(ProcessHandle handle,
53 return HANDLE_EINTR(waitpid(handle, status, 0)) > 0;
56 pid_t ret_pid = HANDLE_EINTR(waitpid(handle, status, WNOHANG));
76 ret_pid = HANDLE_EINTR(waitpid(handle, status, WNOHANG));
87 TerminationStatus GetTerminationStatusImpl(ProcessHandle handle,
91 const pid_t result = HANDLE_EINTR(waitpid(handle, &status,
94 DPLOG(ERROR) << "waitpid(" << handle << ")";
195 TerminationStatus GetTerminationStatus(ProcessHandle handle, int* exit_code) {
196 return GetTerminationStatusImpl(handle, false /* can_block */, exit_code);
199 TerminationStatus GetKnownDeadTerminationStatus(ProcessHandle handle,
201 bool result = kill(handle, SIGKILL) == 0;
204 DPLOG(ERROR) << "Unable to terminate process " << handle;
206 return GetTerminationStatusImpl(handle, true /* can_block */, exit_code);
209 bool WaitForExitCode(ProcessHandle handle, int* exit_code) {
211 if (HANDLE_EINTR(waitpid(handle, &status, 0)) == -1) {
226 bool WaitForExitCodeWithTimeout(ProcessHandle handle,
230 if (!WaitpidWithTimeout(handle, &status, timeout))
268 static bool WaitForSingleNonChildProcess(ProcessHandle handle,
270 DCHECK_GT(handle, 0);
280 EV_SET(&change, handle, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL);
288 DPLOG(ERROR) << "kevent (setup " << handle << ")";
328 DPLOG(ERROR) << "kevent (wait " << handle << ")";
331 DLOG(ERROR) << "kevent (wait " << handle << "): unexpected result "
343 event.ident != static_cast<uintptr_t>(handle)) {
344 DLOG(ERROR) << "kevent (wait " << handle
355 bool WaitForSingleProcess(ProcessHandle handle, base::TimeDelta wait) {
356 ProcessHandle parent_pid = GetParentProcessId(handle);
357 ProcessHandle our_pid = Process::Current().handle();
361 return WaitForSingleNonChildProcess(handle, wait);
363 // Currently on Linux we can't handle non child processes.
369 if (!WaitpidWithTimeout(handle, &status, wait))