Lines Matching refs:pid
32 int pid = os_getpid(), ppid = getppid(); in ptrace_child() local
38 kill(pid, SIGKILL); in ptrace_child()
40 kill(pid, SIGSTOP); in ptrace_child()
48 if (sc_result == pid) in ptrace_child()
95 int pid, n, status; in start_ptraced_child() local
99 pid = fork(); in start_ptraced_child()
100 if (pid == 0) in start_ptraced_child()
102 else if (pid < 0) in start_ptraced_child()
105 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in start_ptraced_child()
112 return pid; in start_ptraced_child()
121 static int stop_ptraced_child(int pid, int exitcode, int mustexit) in stop_ptraced_child() argument
125 if (ptrace(PTRACE_CONT, pid, 0, 0) < 0) { in stop_ptraced_child()
129 CATCH_EINTR(n = waitpid(pid, &status, 0)); in stop_ptraced_child()
167 int pid, n, status, count=0; in check_sysemu() local
171 pid = start_ptraced_child(); in check_sysemu()
173 if (ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0) in check_sysemu()
176 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in check_sysemu()
183 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) in check_sysemu()
191 n = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_RET_OFFSET, os_getpid()); in check_sysemu()
198 if (stop_ptraced_child(pid, 0, 0) < 0) in check_sysemu()
206 pid = start_ptraced_child(); in check_sysemu()
208 if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0, in check_sysemu()
214 if (ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0) in check_sysemu()
216 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in check_sysemu()
227 n = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_RET_OFFSET, in check_sysemu()
243 if (stop_ptraced_child(pid, 0, 0) < 0) in check_sysemu()
254 stop_ptraced_child(pid, 1, 0); in check_sysemu()
261 int pid, syscall, n, status; in check_ptrace() local
264 pid = start_ptraced_child(); in check_ptrace()
266 if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0, in check_ptrace()
271 if (ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) in check_ptrace()
274 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in check_ptrace()
283 syscall = ptrace(PTRACE_PEEKUSER, pid, PT_SYSCALL_NR_OFFSET, in check_ptrace()
286 n = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, in check_ptrace()
294 stop_ptraced_child(pid, 0, 1); in check_ptrace()
358 int pid; in os_early_checks() local
370 pid = start_ptraced_child(); in os_early_checks()
371 if (init_pid_registers(pid)) in os_early_checks()
373 stop_ptraced_child(pid, 1, 1); in os_early_checks()