• Home
  • Raw
  • Download

Lines Matching +full:include +full:- +full:pid

13 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 * Testcase tries killing of the parent namespace pid by the container-init.
18 * It also tries killing of non-existent PID, by the container-init.
24 * 2. The pid of the parent namespace is passed to the container.
25 * 3. Container receieves the PID and passes SIGKILL to this PID.
38 #include <stdio.h>
39 #include <stdlib.h>
40 #include <sys/wait.h>
41 #include <assert.h>
42 #include <unistd.h>
43 #include <errno.h>
44 #include <signal.h>
45 #include "pidns_helper.h"
46 #include "test.h"
50 #define FAKE_PID -1
57 * Cont-init tries to kill the parent-process using parent's global Pid.
58 * Also checks passing SIGKILL to non existent PID in the container.
71 "pid=%d ppid=%d\n", cpid, ppid); in kill_pid_in_childfun()
76 * While trying kill() of the pid of the parent namespace.. in kill_pid_in_childfun()
80 if (ret == -1 && errno == ESRCH) { in kill_pid_in_childfun()
81 printf("Container: killing parent pid=%d failed as expected " in kill_pid_in_childfun()
84 printf("Container: killing parent pid=%d, didn't fail as " in kill_pid_in_childfun()
85 "expected with ESRCH (%d) and a return value of -1. Got " in kill_pid_in_childfun()
91 * While killing non-existent pid in the container, in kill_pid_in_childfun()
95 if (ret == -1 && errno == ESRCH) { in kill_pid_in_childfun()
96 printf("Container: killing non-existent pid failed as expected " in kill_pid_in_childfun()
99 printf("Container: killing non-existent pid, didn't fail as " in kill_pid_in_childfun()
100 "expected with ESRCH (%d) and a return value of -1. Got " in kill_pid_in_childfun()
121 pid_t pid = getpid(); in main() local
123 tst_resm(TINFO, "Parent: Passing the pid of the process %d", pid); in main()
125 (void *)&pid)); in main()
126 if (TEST_RETURN == -1) { in main()
128 } else if (wait(&status) == -1) { in main()