Lines Matching refs:pid

115 static int cg_enter_and_wait_for_frozen(const char *cgroup, int pid,  in cg_enter_and_wait_for_frozen()  argument
125 ret = cg_enter(cgroup, pid); in cg_enter_and_wait_for_frozen()
459 int pid; in test_cgfreezer_mkdir() local
478 pid = cg_run_nowait(child, child_fn, NULL); in test_cgfreezer_mkdir()
479 if (pid < 0) in test_cgfreezer_mkdir()
568 int pid; in test_cgfreezer_migrate() local
584 pid = cg_run_nowait(cgroup[0], child_fn, NULL); in test_cgfreezer_migrate()
585 if (pid < 0) in test_cgfreezer_migrate()
597 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true)) in test_cgfreezer_migrate()
606 if (cg_enter_and_wait_for_frozen(cgroup[0], pid, false)) in test_cgfreezer_migrate()
618 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true)) in test_cgfreezer_migrate()
644 int pid; in test_cgfreezer_ptrace() local
653 pid = cg_run_nowait(cgroup, child_fn, NULL); in test_cgfreezer_ptrace()
654 if (pid < 0) in test_cgfreezer_ptrace()
663 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL)) in test_cgfreezer_ptrace()
666 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL)) in test_cgfreezer_ptrace()
669 waitpid(pid, NULL, 0); in test_cgfreezer_ptrace()
678 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo)) in test_cgfreezer_ptrace()
681 if (ptrace(PTRACE_DETACH, pid, NULL, NULL)) in test_cgfreezer_ptrace()
699 static int proc_check_stopped(int pid) in proc_check_stopped() argument
704 len = proc_read_text(pid, "stat", buf, sizeof(buf)); in proc_check_stopped()
706 debug("Can't get %d stat\n", pid); in proc_check_stopped()
711 debug("Process %d in the unexpected state: %s\n", pid, buf); in proc_check_stopped()
723 int pid, ret = KSFT_FAIL; in test_cgfreezer_stopped() local
733 pid = cg_run_nowait(cgroup, child_fn, NULL); in test_cgfreezer_stopped()
738 if (kill(pid, SIGSTOP)) in test_cgfreezer_stopped()
750 if (proc_check_stopped(pid)) in test_cgfreezer_stopped()
767 int pid, ret = KSFT_FAIL; in test_cgfreezer_ptraced() local
778 pid = cg_run_nowait(cgroup, child_fn, NULL); in test_cgfreezer_ptraced()
783 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL)) in test_cgfreezer_ptraced()
786 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL)) in test_cgfreezer_ptraced()
789 waitpid(pid, NULL, 0); in test_cgfreezer_ptraced()
804 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo)) in test_cgfreezer_ptraced()
807 if (ptrace(PTRACE_DETACH, pid, NULL, NULL)) in test_cgfreezer_ptraced()
821 int pid = vfork(); in vfork_fn() local
823 if (pid == 0) in vfork_fn()
827 return pid; in vfork_fn()