line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2011-2015 by [Mark Overmeer]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.01. |
5
|
3
|
|
|
3
|
|
13418
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
74
|
|
6
|
3
|
|
|
3
|
|
10
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
81
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package POSIX::1003::Sysconf; |
9
|
3
|
|
|
3
|
|
10
|
use vars '$VERSION'; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
112
|
|
10
|
|
|
|
|
|
|
$VERSION = '0.99_07'; |
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
11
|
use base 'POSIX::1003::Module'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
408
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
17
|
use Carp 'croak'; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
260
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my @constants; |
17
|
|
|
|
|
|
|
my @functions = qw/sysconf sysconf_names/; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our %EXPORT_TAGS = |
20
|
|
|
|
|
|
|
( constants => \@constants |
21
|
|
|
|
|
|
|
, functions => \@functions |
22
|
|
|
|
|
|
|
, tables => [ '%sysconf' ] |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $sysconf; |
26
|
|
|
|
|
|
|
our %sysconf; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
BEGIN { |
29
|
3
|
|
|
3
|
|
255
|
$sysconf = sysconf_table; |
30
|
3
|
|
|
|
|
108
|
push @constants, keys %$sysconf; |
31
|
3
|
|
|
|
|
26
|
tie %sysconf, 'POSIX::1003::ReadOnlyTable', $sysconf; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub sysconf($); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub exampleValue($) |
38
|
0
|
|
|
0
|
1
|
0
|
{ my ($class, $name) = @_; |
39
|
0
|
0
|
|
|
|
0
|
$name =~ m/^_SC_/ or return; |
40
|
0
|
|
|
|
|
0
|
my $val = sysconf $name; |
41
|
0
|
0
|
|
|
|
0
|
defined $val ? $val : 'undef'; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub sysconf($) |
46
|
219
|
|
50
|
219
|
1
|
1113
|
{ my $key = shift // return; |
47
|
219
|
100
|
|
|
|
579
|
$key =~ /^_SC_/ |
48
|
|
|
|
|
|
|
or croak "pass the constant name as string"; |
49
|
|
|
|
|
|
|
|
50
|
217
|
|
50
|
|
|
248
|
my $id = $sysconf->{$key} // return; |
51
|
217
|
|
100
|
|
|
1308
|
my $val = POSIX::sysconf($id) // return; |
52
|
139
|
|
|
|
|
158
|
$val+0; # remove " but true" from "0" |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub _create_constant($) |
56
|
1
|
|
|
1
|
|
1
|
{ my ($class, $name) = @_; |
57
|
1
|
|
50
|
0
|
|
4
|
my $id = $sysconf->{$name} // return sub() {undef}; |
|
0
|
|
|
|
|
0
|
|
58
|
1
|
|
|
2
|
|
7
|
sub() {POSIX::sysconf($id)}; |
|
2
|
|
|
|
|
677
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
1
|
1
|
485
|
sub sysconf_names() { keys %$sysconf } |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |