line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Check::Fork; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
73111
|
use base qw(Exporter); |
|
5
|
|
|
|
|
32
|
|
|
5
|
|
|
|
|
663
|
|
4
|
5
|
|
|
5
|
|
31
|
use strict; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
107
|
|
5
|
5
|
|
|
5
|
|
22
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
175
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
43
|
use Config; |
|
5
|
|
|
|
|
24
|
|
|
5
|
|
|
|
|
281
|
|
8
|
5
|
|
|
5
|
|
2640
|
use Readonly; |
|
5
|
|
|
|
|
20114
|
|
|
5
|
|
|
|
|
1393
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $ERROR_MESSAGE; |
11
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(check_fork $ERROR_MESSAGE); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = 0.04; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub check_fork { |
16
|
9
|
|
|
9
|
1
|
5638
|
my ($config_hr, $os) = @_; |
17
|
|
|
|
|
|
|
|
18
|
9
|
|
100
|
|
|
32
|
$config_hr ||= \%Config; |
19
|
9
|
|
66
|
|
|
26
|
$os ||= $^O; |
20
|
|
|
|
|
|
|
|
21
|
9
|
100
|
100
|
|
|
107
|
if ($config_hr->{'d_fork'}) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
22
|
2
|
|
|
|
|
9
|
return 1; |
23
|
|
|
|
|
|
|
} elsif ($config_hr->{'d_pseudofork'}) { |
24
|
1
|
|
|
|
|
4
|
return 1; |
25
|
|
|
|
|
|
|
} elsif ($os eq 'MSWin32' || $os eq 'NetWare') { |
26
|
5
|
100
|
|
|
|
15
|
if (! $config_hr->{'useithreads'}) { |
27
|
2
|
|
|
|
|
6
|
$ERROR_MESSAGE = "$os: No interpreter-based threading implementation."; |
28
|
2
|
|
|
|
|
7
|
return 0; |
29
|
|
|
|
|
|
|
} |
30
|
3
|
100
|
|
|
|
13
|
if ($config_hr->{'ccflags'} !~ /-DPERL_IMPLICIT_SYS/) { |
31
|
1
|
|
|
|
|
4
|
$ERROR_MESSAGE = "$os: No PERL_IMPLICIT_SYS ccflags set."; |
32
|
1
|
|
|
|
|
3
|
return 0; |
33
|
|
|
|
|
|
|
} |
34
|
2
|
|
|
|
|
7
|
return 1; |
35
|
|
|
|
|
|
|
} |
36
|
1
|
|
|
|
|
3
|
$ERROR_MESSAGE = 'No fork() routine available.'; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
3
|
return 0; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |