Lines Matching refs:pid
116 static int cg_enter_and_wait_for_frozen(const char *cgroup, int pid,
126 ret = cg_enter(cgroup, pid);
460 int pid;
479 pid = cg_run_nowait(child, child_fn, NULL);
480 if (pid < 0)
569 int pid;
585 pid = cg_run_nowait(cgroup[0], child_fn, NULL);
586 if (pid < 0)
598 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true))
607 if (cg_enter_and_wait_for_frozen(cgroup[0], pid, false))
619 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true))
645 int pid;
654 pid = cg_run_nowait(cgroup, child_fn, NULL);
655 if (pid < 0)
664 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL))
667 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL))
670 waitpid(pid, NULL, 0);
679 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo))
682 if (ptrace(PTRACE_DETACH, pid, NULL, NULL))
700 static int proc_check_stopped(int pid)
705 len = proc_read_text(pid, 0, "stat", buf, sizeof(buf));
707 debug("Can't get %d stat\n", pid);
712 debug("Process %d in the unexpected state: %s\n", pid, buf);
724 int pid, ret = KSFT_FAIL;
734 pid = cg_run_nowait(cgroup, child_fn, NULL);
739 if (kill(pid, SIGSTOP))
751 if (proc_check_stopped(pid))
768 int pid, ret = KSFT_FAIL;
779 pid = cg_run_nowait(cgroup, child_fn, NULL);
784 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL))
787 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL))
790 waitpid(pid, NULL, 0);
805 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo))
808 if (ptrace(PTRACE_DETACH, pid, NULL, NULL))
822 int pid = vfork();
824 if (pid == 0)
828 return pid;