Lines Matching full:pid

6  * PID namespace.
45 pid_t pid = -1; in call_clone3_set_tid() local
54 pid = sys_clone3(&args, sizeof(args)); in call_clone3_set_tid()
55 if (pid < 0) { in call_clone3_set_tid()
61 if (pid == 0) { in call_clone3_set_tid()
66 ksft_print_msg("I am the child, my PID is %d (expected %d)\n", in call_clone3_set_tid()
96 if (expected_pid == 0 || expected_pid == pid) { in call_clone3_set_tid()
97 ksft_print_msg("I am the parent (%d). My child's pid is %d\n", in call_clone3_set_tid()
98 getpid(), pid); in call_clone3_set_tid()
101 "Expected child pid %d does not match actual pid %d\n", in call_clone3_set_tid()
102 expected_pid, pid); in call_clone3_set_tid()
106 if (waitpid(pid, &status, 0) < 0) { in call_clone3_set_tid()
154 pid_t pid, ns1, ns2, ns3, ns_pid; in main() local
186 * nested PID namespace. in main()
202 * nested PID namespace. in main()
207 /* Try with an invalid PID */ in main()
217 /* Try it in a new PID namespace */ in main()
223 /* Try with a valid PID (1) this should return -EEXIST. */ in main()
230 /* Try it in a new PID namespace */ in main()
254 /* Find the current active PID */ in main()
255 pid = fork(); in main()
256 if (pid == 0) { in main()
257 ksft_print_msg("Child has PID %d\n", getpid()); in main()
260 if (waitpid(pid, &status, 0) < 0) in main()
261 ksft_exit_fail_msg("Waiting for child %d failed", pid); in main()
263 /* After the child has finished, its PID should be free. */ in main()
264 set_tid[0] = pid; in main()
267 /* This should fail as there is no PID 1 in that namespace */ in main()
271 * Creating a process with PID 1 in the newly created most nested in main()
272 * PID namespace and PID 'pid' in the parent PID namespace. This in main()
276 set_tid[1] = pid; in main()
277 test_clone3_set_tid(set_tid, 2, CLONE_NEWPID, 0, pid, 0); in main()
279 ksft_print_msg("unshare PID namespace\n"); in main()
284 set_tid[0] = pid; in main()
286 /* This should fail as there is no PID 1 in that namespace */ in main()
289 /* Let's create a PID 1 */ in main()
293 * This and the next test cases check that all pid-s are in main()
301 set_tid[1] = pid; in main()
304 ksft_print_msg("Child in PID namespace has PID %d\n", getpid()); in main()
310 set_tid[2] = pid; in main()
311 /* This should fail as there is invalid PID at level '1'. */ in main()
316 set_tid[2] = pid; in main()
318 * This should fail as there are not enough active PID in main()
320 * PID namespace. Not yet nested. in main()
326 * something like 'NSpid: pid 42 1'. in main()
340 snprintf(proc_path, sizeof(proc_path), "/proc/%d/status", pid); in main()
383 if (ns3 == pid && ns2 == 42 && ns1 == 1) in main()