line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Check::Fork; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
61042
|
use base qw(Exporter); |
|
5
|
|
|
|
|
30
|
|
|
5
|
|
|
|
|
741
|
|
4
|
5
|
|
|
5
|
|
29
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
111
|
|
5
|
5
|
|
|
5
|
|
24
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
136
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
37
|
use Config; |
|
5
|
|
|
|
|
22
|
|
|
5
|
|
|
|
|
326
|
|
8
|
5
|
|
|
5
|
|
2261
|
use Readonly; |
|
5
|
|
|
|
|
16896
|
|
|
5
|
|
|
|
|
1252
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $ERROR_MESSAGE; |
11
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(check_fork $ERROR_MESSAGE); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = 0.02; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub check_fork { |
16
|
9
|
|
|
9
|
1
|
5324
|
my ($config_hr, $os) = @_; |
17
|
|
|
|
|
|
|
|
18
|
9
|
|
100
|
|
|
30
|
$config_hr ||= \%Config; |
19
|
9
|
|
66
|
|
|
24
|
$os ||= $^O; |
20
|
|
|
|
|
|
|
|
21
|
9
|
100
|
100
|
|
|
102
|
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
|
|
|
|
14
|
if (! $config_hr->{'useithreads'}) { |
27
|
2
|
|
|
|
|
5
|
$ERROR_MESSAGE = "$os: No interpreter-based threading implementation."; |
28
|
2
|
|
|
|
|
4
|
return 0; |
29
|
|
|
|
|
|
|
} |
30
|
3
|
100
|
|
|
|
13
|
if ($config_hr->{'ccflags'} !~ /-DPERL_IMPLICIT_SYS/) { |
31
|
1
|
|
|
|
|
3
|
$ERROR_MESSAGE = "$os: No PERL_IMPLICIT_SYS ccflags set."; |
32
|
1
|
|
|
|
|
3
|
return 0; |
33
|
|
|
|
|
|
|
} |
34
|
2
|
|
|
|
|
6
|
return 1; |
35
|
|
|
|
|
|
|
} |
36
|
1
|
|
|
|
|
2
|
$ERROR_MESSAGE = 'No fork() routine available.'; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
2
|
return 0; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |