Lines Matching refs:pid
110 pid_t pid = vfork(); in fork_execute_cmd() local
111 if (pid < 0) { in fork_execute_cmd()
115 if (pid == 0) { in fork_execute_cmd()
134 kill_child(pid); in fork_execute_cmd()
137 return pid; in fork_execute_cmd()
182 static bool waitpid_with_timeout(pid_t pid, int timeout_ms, int* status) { in waitpid_with_timeout() argument
194 pid_t child_pid = waitpid(pid, status, WNOHANG); in waitpid_with_timeout()
195 if (child_pid != pid) { in waitpid_with_timeout()
197 ALOGW("*** Waiting for pid %d, got pid %d instead\n", pid, child_pid); in waitpid_with_timeout()
230 child_pid = waitpid(pid, status, WNOHANG); in waitpid_with_timeout()
231 if (child_pid != pid) { in waitpid_with_timeout()
233 ALOGW("*** Waiting for pid %d, got pid %d instead\n", pid, child_pid); in waitpid_with_timeout()
242 status_t kill_child(pid_t pid) { in kill_child() argument
244 kill(pid, SIGKILL); in kill_child()
245 if (waitpid(pid, &status, 0) == -1) return -1; in kill_child()
249 status_t wait_child(pid_t pid, int timeout_ms) { in wait_child() argument
251 if (waitpid_with_timeout(pid, timeout_ms, &status)) { in wait_child()
254 return kill_child(pid); in wait_child()