This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RE: [perl #26136] localtime(3) calls tzset(3), but localtime_r(3) may not.
[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: 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 ?C:HAS_VFORK (VFORK):
46 ?C:     This symbol, if defined, indicates that vfork() exists.
47 ?C:.
48 ?H:#$d_vfork HAS_VFORK  /**/
49 ?H:.
50 ?M:vfork: HAS_VFORK
51 ?M:#ifndef HAS_VFORK
52 ?M:#define vfork fork
53 ?M:#endif
54 ?M:.
55 ?LINT:set d_vfork
56 ?X: TO BE REMOVED in dist 4.0
57 ?X:==========================
58 ?T:d_hvfork
59 : backward compatibility for d_hvfork
60 if test X$d_hvfork != X; then
61         d_vfork="$d_hvfork"
62         d_hvfork=''
63 fi
64 ?X:==========================
65 : see if there is a vfork
66 val=''
67 set vfork val
68 eval $inlibc
69
70 : Ok, but do we want to use it. vfork is reportedly unreliable in 
71 : perl on Solaris 2.x, and probably elsewhere.
72 case "$val" in
73 $define)
74         echo " "
75         case "$usevfork" in
76         false) dflt='n';;
77         *) dflt='y';;
78         esac
79         cat <<'EOM'
80  
81 Perl can only use a vfork() that doesn't suffer from strict
82 restrictions on calling functions or modifying global data in
83 the child.  For example, glibc-2.1 contains such a vfork()
84 that is unsuitable.  If your system provides a proper fork()
85 call, chances are that you do NOT want perl to use vfork().
86
87 EOM
88         rp="Do you still want to use vfork()?"
89         . ./myread
90         case "$ans" in
91         y|Y) ;;
92         *)
93                 echo "Ok, we won't use vfork()."
94                 val="$undef"
95                 ;;
96         esac
97         ;;
98 esac
99 ?X:
100 ?X: Only set it when final value is known to avoid spurious Whoas
101 ?X: Then set usevfork accordingly to the current value, for next run
102 ?X:
103 set d_vfork
104 eval $setvar
105 case "$d_vfork" in
106 $define) usevfork='true';;
107 *) usevfork='false';;
108 esac
109