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