Lines Matching refs:pid
105 pid_t pid; in run_in_process() local
107 pid = fork(); in run_in_process()
108 if (pid < 0) { in run_in_process()
113 if (pid == 0) in run_in_process()
117 *pidp = pid; in run_in_process()
128 wait_and_timeout(pid_t pid, int timeout, int *status, const char *errstr) in wait_and_timeout() argument
138 wpid = waitpid(pid, status, WNOHANG); in wait_and_timeout()
140 warn("%s: wait_and_timeout: waitpid %d", errstr, pid); in wait_and_timeout()
144 if (wpid == pid) in wait_and_timeout()
150 wpid = waitpid(pid, status, WNOHANG); in wait_and_timeout()
152 warn("%s: wait_and_timeout: waitpid %d", errstr, pid); in wait_and_timeout()
156 if (wpid == pid) in wait_and_timeout()
159 if (kill(pid, SIGTERM) < 0) { in wait_and_timeout()
160 warn("%s: wait_and_timeout: kill %d", errstr, pid); in wait_and_timeout()
164 wpid = waitpid(pid, status, 0); in wait_and_timeout()
166 warn("%s: wait_and_timeout: waitpid %d", errstr, pid); in wait_and_timeout()
170 if (wpid != pid) { in wait_and_timeout()
171 warn("%s: waitpid: returned %d not %d", errstr, wpid, pid); in wait_and_timeout()
389 pid_t pid; in test_non_blocking_reader() local
394 if (run_in_process(non_blocking_open_reader, &pid, in test_non_blocking_reader()
401 if (wait_and_timeout(pid, 5, &status, in test_non_blocking_reader()
422 pid_t pid; in test_non_blocking_writer() local
427 if (run_in_process(non_blocking_open_writer, &pid, in test_non_blocking_writer()
434 if (wait_and_timeout(pid, 5, &status, in test_non_blocking_writer()