Diffstat (limited to 'mcon/U/d_pidcheck.U')
1 files changed, 75 insertions, 0 deletions
diff --git a/mcon/U/d_pidcheck.U b/mcon/U/d_pidcheck.U
new file mode 100644
@@ -0,0 +1,75 @@
+?RCS: $Id: d_pidcheck.U,v 18.104.22.168 1997/02/28 15:37:55 ram Exp $
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS: $Log: d_pidcheck.U,v $
+?RCS: Revision 22.214.171.124 1997/02/28 15:37:55 ram
+?RCS: patch61: replaced .o with $_o all over the place
+?RCS: patch61: added ?F: metalint hint
+?RCS: Revision 3.0 1993/08/18 12:06:46 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?MAKE:d_pidcheck: cat rm +cc _o
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines the variable PIDCHECK
+?S: which indicates that kill(pid, 0) will check for an active pid.
+?C: This symbol, if defined, means that the kill(pid, 0) will
+?C: check for an active pid (i.e. the kernel will run all the
+?C: necessary pid checks, but no signal is actually sent).
+?H:#$d_pidcheck PIDCHECK /**/
+: check for "kill(pid, 0)"
+echo " "
+case "$d_pidcheck" in
+echo "I already know your system supports kill(pid, 0) for pid checks." >&4
+echo "We both know your system does not support signal #0 for pid checks." >&4
+ echo "Checking to see if kill(pid, 0) works..." >&4
+ $cat >try.c <<'EOCP'
+ int pid, status0, status9;
+ if ((pid = fork()) == 0)
+ status0 = kill(pid, 0);
+ status9 = kill(pid, 9);
+ exit(status0 == status9);
+ if $cc try.c -o try >/dev/null 2>&1 ; then
+ if ./try >/dev/null 2>&1 ; then
+ echo "Yes, it does marvels."
+ echo "No, it doesn't."
+ echo "(I was unable to compile the test program.)"
+ echo "Your system does not appear to support kill(pid, 0)."
+ $rm -f try.c try$_o try