Lines Matching refs:pid
35 int pid = os_getpid(), ppid = getppid(); in ptrace_child() local
41 kill(pid, SIGKILL); in ptrace_child()
43 kill(pid, SIGSTOP); in ptrace_child()
51 if (sc_result == pid) in ptrace_child()
98 int pid, n, status; in start_ptraced_child() local
102 pid = fork(); in start_ptraced_child()
103 if (pid == 0) in start_ptraced_child()
105 else if (pid < 0) in start_ptraced_child()
108 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in start_ptraced_child()
115 return pid; in start_ptraced_child()
118 static void stop_ptraced_child(int pid, int exitcode) in stop_ptraced_child() argument
122 if (ptrace(PTRACE_CONT, pid, 0, 0) < 0) in stop_ptraced_child()
125 CATCH_EINTR(n = waitpid(pid, &status, 0)); in stop_ptraced_child()
136 int pid, n, status, count=0; in check_sysemu() local
139 pid = start_ptraced_child(); in check_sysemu()
141 if ((ptrace(PTRACE_SETOPTIONS, pid, 0, in check_sysemu()
147 if (ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0) in check_sysemu()
149 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in check_sysemu()
160 n = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_RET_OFFSET, in check_sysemu()
176 stop_ptraced_child(pid, 0); in check_sysemu()
183 stop_ptraced_child(pid, 1); in check_sysemu()
189 int pid, syscall, n, status; in check_ptrace() local
192 pid = start_ptraced_child(); in check_ptrace()
194 if ((ptrace(PTRACE_SETOPTIONS, pid, 0, in check_ptrace()
199 if (ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) in check_ptrace()
202 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in check_ptrace()
211 syscall = ptrace(PTRACE_PEEKUSER, pid, PT_SYSCALL_NR_OFFSET, in check_ptrace()
214 n = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, in check_ptrace()
222 stop_ptraced_child(pid, 0); in check_ptrace()
284 int pid; in os_early_checks() local
296 pid = start_ptraced_child(); in os_early_checks()
297 if (init_pid_registers(pid)) in os_early_checks()
299 stop_ptraced_child(pid, 1); in os_early_checks()