Lines Matching refs:pid
43 int pid = os_getpid(), ppid = getppid(); in ptrace_child() local
49 kill(pid, SIGKILL); in ptrace_child()
51 kill(pid, SIGSTOP); in ptrace_child()
59 if (sc_result == pid) in ptrace_child()
106 int pid, n, status; in start_ptraced_child() local
110 pid = fork(); in start_ptraced_child()
111 if (pid == 0) in start_ptraced_child()
113 else if (pid < 0) in start_ptraced_child()
116 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in start_ptraced_child()
123 return pid; in start_ptraced_child()
126 static void stop_ptraced_child(int pid, int exitcode) in stop_ptraced_child() argument
130 if (ptrace(PTRACE_CONT, pid, 0, 0) < 0) in stop_ptraced_child()
133 CATCH_EINTR(n = waitpid(pid, &status, 0)); in stop_ptraced_child()
144 int pid, n, status, count=0; in check_sysemu() local
147 pid = start_ptraced_child(); in check_sysemu()
149 if ((ptrace(PTRACE_SETOPTIONS, pid, 0, in check_sysemu()
155 if (ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0) in check_sysemu()
157 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in check_sysemu()
168 n = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_RET_OFFSET, in check_sysemu()
184 stop_ptraced_child(pid, 0); in check_sysemu()
191 stop_ptraced_child(pid, 1); in check_sysemu()
197 int pid, syscall, n, status; in check_ptrace() local
200 pid = start_ptraced_child(); in check_ptrace()
202 if ((ptrace(PTRACE_SETOPTIONS, pid, 0, in check_ptrace()
207 if (ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) in check_ptrace()
210 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in check_ptrace()
219 syscall = ptrace(PTRACE_PEEKUSER, pid, PT_SYSCALL_NR_OFFSET, in check_ptrace()
222 n = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, in check_ptrace()
230 stop_ptraced_child(pid, 0); in check_ptrace()
294 int pid; in init_seccomp() local
317 pid = clone(seccomp_helper, (void *)sp, CLONE_VFORK | CLONE_VM, NULL); in init_seccomp()
319 if (pid < 0) in init_seccomp()
322 CATCH_EINTR(n = waitpid(pid, &status, __WCLONE)); in init_seccomp()
464 int pid; in os_early_checks() local
487 pid = start_ptraced_child(); in os_early_checks()
488 if (init_pid_registers(pid)) in os_early_checks()
490 stop_ptraced_child(pid, 1); in os_early_checks()