1 ?RCS: $Id: d_setpgrp.U,v 3.0.1.3 1997/02/28 15:44:16 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic License,
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 License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: $Log: d_setpgrp.U,v $
12 ?RCS: Revision 3.0.1.3 1997/02/28 15:44:16 ram
13 ?RCS: patch61: obsoleted USE_BSDGRP in favor of USE_BSD_SETPGRP
14 ?RCS: patch61: another unit now also defines a USE_BSD_GETPGRP
15 ?RCS: patch61: fallback for test program failure improved
17 ?RCS: Revision 3.0.1.2 1995/07/25 13:59:30 ram
18 ?RCS: patch56: re-arranged compile line to include ldflags before objects
20 ?RCS: Revision 3.0.1.1 1994/10/29 16:15:37 ram
21 ?RCS: patch36: added 'ldflags' to the test compile line (ADO)
22 ?RCS: patch36: call ./usg explicitly instead of relying on PATH
24 ?RCS: Revision 3.0 1993/08/18 12:07:09 ram
25 ?RCS: Baseline for dist 3.0 netwide release.
27 ?MAKE:d_setpgrp d_bsdsetpgrp: cat rm_try +cc +libs +ccflags \
28 +ldflags Inlibc Guess Setvar i_unistd i_stdlib run
29 ?MAKE: -pick add $@ %<
31 ?S: This variable conditionally defines HAS_SETPGRP if setpgrp() is
32 ?S: available to set the current process group.
34 ?S:d_bsdsetpgrp (d_bsdpgrp):
35 ?S: This variable conditionally defines USE_BSD_SETPGRP if
36 ?S: setpgrp needs two arguments whereas USG one needs none.
37 ?S: See also d_setpgid for a POSIX interface.
39 ?C:HAS_SETPGRP (SETPGRP):
40 ?C: This symbol, if defined, indicates that the setpgrp routine is
41 ?C: available to set the current process group.
43 ?C:USE_BSD_SETPGRP (USE_BSDPGRP BSDPGRP):
44 ?C: This symbol, if defined, indicates that setpgrp needs two
45 ?C: arguments whereas USG one needs none. See also HAS_SETPGID
46 ?C: for a POSIX interface.
48 ?H:#$d_setpgrp HAS_SETPGRP /**/
49 ?H:#$d_bsdsetpgrp USE_BSD_SETPGRP /**/
53 ?LINT:set d_setpgrp d_bsdsetpgrp
54 : see if setpgrp exists
58 @if USE_BSD_SETPGRP || d_bsdsetpgrp
62 echo "Checking to see which flavor of setpgrp is in use..."
65 #include <sys/types.h>
76 printf("(I see you are running Configure as super-user...)\n");
80 if (-1 == setpgrp(1, 1))
89 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
90 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
92 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
93 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
96 echo "(I can't seem to compile and run the test program.)"
98 xxx="a USG one, i.e. you use setpgrp()."
100 # SVR4 systems can appear rather BSD-ish.
103 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
107 xxx="probably a USG one, i.e. you use setpgrp()."
112 echo "Assuming your setpgrp is $xxx" >&4