This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Silence metalint
[metaconfig.git] / U / modified / d_vfork.U
1 ?RCS: $Id: d_vfork.U,v 3.0.1.6 1994/08/29 16:18:21 ram Exp $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
4 ?RCS:
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.
10 ?RCS:
11 ?RCS: $Log: d_vfork.U,v $
12 ?RCS: Revision 3.0.1.6  1994/08/29  16:18:21  ram
13 ?RCS: patch32: set default to 'y' the first time
14 ?RCS:
15 ?RCS: Revision 3.0.1.5  1994/06/20  06:59:14  ram
16 ?RCS: patch30: usevfork was not always properly set
17 ?RCS:
18 ?RCS: Revision 3.0.1.4  1994/05/13  15:20:56  ram
19 ?RCS: patch27: modified to avoid spurious Whoa warnings (ADO)
20 ?RCS:
21 ?RCS: Revision 3.0.1.3  1994/05/06  14:59:09  ram
22 ?RCS: patch23: now explicitely ask whether vfork() should be used (ADO)
23 ?RCS:
24 ?RCS: Revision 3.0.1.2  1993/10/16  13:49:39  ram
25 ?RCS: patch12: added magic for vfork()
26 ?RCS:
27 ?RCS: Revision 3.0.1.1  1993/09/13  16:06:57  ram
28 ?RCS: patch10: removed automatic remapping of vfork on fork (WAD)
29 ?RCS: patch10: added compatibility code for older config.sh (WAD)
30 ?RCS:
31 ?RCS: Revision 3.0  1993/08/18  12:07:55  ram
32 ?RCS: Baseline for dist 3.0 netwide release.
33 ?RCS:
34 ?MAKE:d_vfork usevfork d_pseudofork: Inlibc Myread Oldconfig Setvar
35 ?MAKE:  -pick add $@ %<
36 ?S:d_vfork:
37 ?S:     This variable conditionally defines the HAS_VFORK symbol, which
38 ?S:     indicates the vfork() routine is available.
39 ?S:.
40 ?S:usevfork:
41 ?S:     This variable is set to true when the user accepts to use vfork.
42 ?S:     It is set to false when no vfork is available or when the user
43 ?S:     explicitely requests not to use vfork.
44 ?S:.
45 ?S:d_pseudofork:
46 ?S:     This variable conditionally defines the HAS_PSEUDOFORK symbol,
47 ?S:     which indicates that an emulation of the fork routine is available.
48 ?S:.
49 ?C:HAS_VFORK (VFORK):
50 ?C:     This symbol, if defined, indicates that vfork() exists.
51 ?C:.
52 ?H:#$d_vfork HAS_VFORK  /**/
53 ?H:.
54 ?C:HAS_PSEUDOFORK:
55 ?C:     This symbol, if defined, indicates that an emulation of the
56 ?C:     fork routine is available.
57 ?C:.
58 ?H:#$d_pseudofork HAS_PSEUDOFORK        /**/
59 ?H:.
60 ?M:vfork: HAS_VFORK
61 ?M:#ifndef HAS_VFORK
62 ?M:#define vfork fork
63 ?M:#endif
64 ?M:.
65 ?T:d_hvfork
66 : backward compatibility for d_hvfork
67 if test X$d_hvfork != X; then
68         d_vfork="$d_hvfork"
69         d_hvfork=''
70 fi
71 ?X:==========================
72 : see if there is a vfork
73 val=''
74 set vfork val
75 eval $inlibc
76
77 d_pseudofork=$undef
78
79 : Ok, but do we want to use it. vfork is reportedly unreliable in
80 : perl on Solaris 2.x, and probably elsewhere.
81 case "$val" in
82 $define)
83         echo " "
84         case "$usevfork" in
85         false) dflt='n';;
86         *) dflt='y';;
87         esac
88         cat <<'EOM'
89
90 Perl can only use a vfork() that doesn't suffer from strict
91 restrictions on calling functions or modifying global data in
92 the child.  For example, glibc-2.1 contains such a vfork()
93 that is unsuitable.  If your system provides a proper fork()
94 call, chances are that you do NOT want perl to use vfork().
95
96 EOM
97         rp="Do you still want to use vfork()?"
98         . ./myread
99         case "$ans" in
100         y|Y) ;;
101         *)
102                 echo "Ok, we won't use vfork()."
103                 val="$undef"
104                 ;;
105         esac
106         ;;
107 esac
108 ?X:
109 ?X: Only set it when final value is known to avoid spurious Whoas
110 ?X: Then set usevfork accordingly to the current value, for next run
111 ?X:
112 set d_vfork
113 eval $setvar
114 case "$d_vfork" in
115 $define) usevfork='true';;
116 *) usevfork='false';;
117 esac
118