]>
git.saurik.com Git - apple/launchd.git/blob - launchd/testing/our_kill_is_busted.c
16 int kill_r
, killpg_r
, r
;
31 kill_r
= kill(p
, SIGTERM
);
35 killpg_r
= kill(-(p
), SIGTERM
);
38 if (kill_r
!= killpg_r
) {
39 fprintf(stderr
, "Bug. kill() is inconsistent.\n");
40 fprintf(stderr
, "kill( p, SIGTERM) returned %d and errno == %d\n", kill_r
, kill_e
);
41 fprintf(stderr
, "kill(-(p), SIGTERM) returned %d and errno == %d\n", killpg_r
, killpg_e
);
42 if (kill_e
== EPERM
|| killpg_e
== EPERM
) {
43 fprintf(stderr
, "The kernel lied. We should have the right to kill 'p' and it returned EPERM.\n");
45 if (kill_e
== ESRCH
|| killpg_e
== ESRCH
) {
46 fprintf(stderr
, "The kernel is confused. PID 'p' exists, but the kernel couldn't find it.\n");
52 wr
= waitpid(p
, &wstatus
, 0);