1 ?RCS: $Id: d_pidcheck.U,v 3.0.1.1 1997/02/28 15:37:55 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: $Log: d_pidcheck.U,v $
12 ?RCS: Revision 3.0.1.1 1997/02/28 15:37:55 ram
13 ?RCS: patch61: replaced .o with $_o all over the place
14 ?RCS: patch61: added ?F: metalint hint
16 ?RCS: Revision 3.0 1993/08/18 12:06:46 ram
17 ?RCS: Baseline for dist 3.0 netwide release.
19 ?MAKE:d_pidcheck: cat rm +cc _o
20 ?MAKE: -pick add $@ %<
22 ?S: This variable conditionally defines the variable PIDCHECK
23 ?S: which indicates that kill(pid, 0) will check for an active pid.
26 ?C: This symbol, if defined, means that the kill(pid, 0) will
27 ?C: check for an active pid (i.e. the kernel will run all the
28 ?C: necessary pid checks, but no signal is actually sent).
30 ?H:#$d_pidcheck PIDCHECK /**/
33 : check for "kill(pid, 0)"
37 echo "I already know your system supports kill(pid, 0) for pid checks." >&4
40 echo "We both know your system does not support signal #0 for pid checks." >&4
43 echo "Checking to see if kill(pid, 0) works..." >&4
47 int pid, status0, status9;
49 if ((pid = fork()) == 0)
54 status0 = kill(pid, 0);
55 status9 = kill(pid, 9);
56 exit(status0 == status9);
59 if $cc -o try try.c >/dev/null 2>&1 ; then
60 if ./try >/dev/null 2>&1 ; then
61 echo "Yes, it does marvels."
65 echo "No, it doesn't."
68 echo "(I was unable to compile the test program.)"
69 echo "Your system does not appear to support kill(pid, 0)."
72 $rm -f try.c try$_o try