Lines Matching full:pid

6  * PID namespace.
47 pid_t pid = -1; in call_clone3_set_tid() local
56 pid = sys_clone3(&args, sizeof(args)); in call_clone3_set_tid()
57 if (pid < 0) { in call_clone3_set_tid()
63 if (pid == 0) { in call_clone3_set_tid()
68 ksft_print_msg("I am the child, my PID is %d (expected %d)\n", in call_clone3_set_tid()
98 if (expected_pid == 0 || expected_pid == pid) { in call_clone3_set_tid()
99 ksft_print_msg("I am the parent (%d). My child's pid is %d\n", in call_clone3_set_tid()
100 getpid(), pid); in call_clone3_set_tid()
103 "Expected child pid %d does not match actual pid %d\n", in call_clone3_set_tid()
104 expected_pid, pid); in call_clone3_set_tid()
108 if (waitpid(pid, &status, 0) < 0) { in call_clone3_set_tid()
156 pid_t pid, ns1, ns2, ns3, ns_pid; in main() local
188 * nested PID namespace. in main()
204 * nested PID namespace. in main()
209 /* Try with an invalid PID */ in main()
219 /* Try it in a new PID namespace */ in main()
225 /* Try with a valid PID (1) this should return -EEXIST. */ in main()
232 /* Try it in a new PID namespace */ in main()
256 /* Find the current active PID */ in main()
257 pid = fork(); in main()
258 if (pid == 0) { in main()
259 ksft_print_msg("Child has PID %d\n", getpid()); in main()
262 if (waitpid(pid, &status, 0) < 0) in main()
263 ksft_exit_fail_msg("Waiting for child %d failed", pid); in main()
265 /* After the child has finished, its PID should be free. */ in main()
266 set_tid[0] = pid; in main()
269 /* This should fail as there is no PID 1 in that namespace */ in main()
273 * Creating a process with PID 1 in the newly created most nested in main()
274 * PID namespace and PID 'pid' in the parent PID namespace. This in main()
278 set_tid[1] = pid; in main()
279 test_clone3_set_tid(set_tid, 2, CLONE_NEWPID, 0, pid, 0); in main()
281 ksft_print_msg("unshare PID namespace\n"); in main()
286 set_tid[0] = pid; in main()
288 /* This should fail as there is no PID 1 in that namespace */ in main()
291 /* Let's create a PID 1 */ in main()
295 * This and the next test cases check that all pid-s are in main()
303 set_tid[1] = pid; in main()
306 ksft_print_msg("Child in PID namespace has PID %d\n", getpid()); in main()
312 set_tid[2] = pid; in main()
313 /* This should fail as there is invalid PID at level '1'. */ in main()
318 set_tid[2] = pid; in main()
320 * This should fail as there are not enough active PID in main()
322 * PID namespace. Not yet nested. in main()
328 * something like 'NSpid: pid 42 1'. in main()
342 snprintf(proc_path, sizeof(proc_path), "/proc/%d/status", pid); in main()
385 if (ns3 == pid && ns2 == 42 && ns1 == 1) in main()