Lines Matching defs:pid
59 static int cg_enter_and_wait_for_frozen(const char *cgroup, int pid,
69 ret = cg_enter(cgroup, pid);
403 int pid;
422 pid = cg_run_nowait(child, child_fn, NULL);
423 if (pid < 0)
512 int pid;
528 pid = cg_run_nowait(cgroup[0], child_fn, NULL);
529 if (pid < 0)
541 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true))
550 if (cg_enter_and_wait_for_frozen(cgroup[0], pid, false))
562 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true))
588 int pid;
597 pid = cg_run_nowait(cgroup, child_fn, NULL);
598 if (pid < 0)
607 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL))
610 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL))
613 waitpid(pid, NULL, 0);
622 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo))
625 if (ptrace(PTRACE_DETACH, pid, NULL, NULL))
643 static int proc_check_stopped(int pid)
648 len = proc_read_text(pid, 0, "stat", buf, sizeof(buf));
650 debug("Can't get %d stat\n", pid);
655 debug("Process %d in the unexpected state: %s\n", pid, buf);
667 int pid, ret = KSFT_FAIL;
677 pid = cg_run_nowait(cgroup, child_fn, NULL);
682 if (kill(pid, SIGSTOP))
694 if (proc_check_stopped(pid))
711 int pid, ret = KSFT_FAIL;
722 pid = cg_run_nowait(cgroup, child_fn, NULL);
727 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL))
730 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL))
733 waitpid(pid, NULL, 0);
748 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo))
751 if (ptrace(PTRACE_DETACH, pid, NULL, NULL))
765 int pid = vfork();
767 if (pid == 0)
771 return pid;