line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Linux::Unshare; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
48956
|
use 5.010000; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
82
|
|
4
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
120
|
|
5
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
60
|
|
6
|
2
|
|
|
2
|
|
12
|
use Carp; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
230
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
2
|
|
|
2
|
|
1624
|
use AutoLoader; |
|
2
|
|
|
|
|
3382
|
|
|
2
|
|
|
|
|
14
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# This allows declaration use Linux::Unshare ':all'; |
14
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'clone' => [ qw( |
15
|
|
|
|
|
|
|
CLONE_THREAD CLONE_FS CLONE_NEWNS CLONE_SIGHAND CLONE_VM |
16
|
|
|
|
|
|
|
CLONE_FILES CLONE_SYSVSEM CLONE_NEWUTS CLONE_NEWIPC CLONE_NEWNET |
17
|
|
|
|
|
|
|
) ] ); |
18
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'clone'} }, qw(unshare unshare_ns) ); |
19
|
|
|
|
|
|
|
our @EXPORT = qw( ); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub AUTOLOAD { |
24
|
1
|
|
|
1
|
|
210434
|
my $constname; |
25
|
1
|
|
|
|
|
6
|
our $AUTOLOAD; |
26
|
1
|
|
|
|
|
14
|
($constname = $AUTOLOAD) =~ s/.*:://; |
27
|
1
|
50
|
|
|
|
11
|
croak "&Linux::Unshare::constant not defined" if $constname eq 'constant'; |
28
|
1
|
|
|
|
|
27
|
my ($error, $val) = constant($constname); |
29
|
1
|
50
|
|
|
|
6
|
if ($error) { croak $error; } |
|
1
|
|
|
|
|
1047
|
|
30
|
|
|
|
|
|
|
{ |
31
|
2
|
|
|
2
|
|
386
|
no strict 'refs'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
274
|
|
|
0
|
|
|
|
|
0
|
|
32
|
0
|
|
|
0
|
|
0
|
*$AUTOLOAD = sub { $val }; |
|
0
|
|
|
|
|
0
|
|
33
|
|
|
|
|
|
|
} |
34
|
0
|
|
|
|
|
0
|
goto &$AUTOLOAD; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
require XSLoader; |
38
|
|
|
|
|
|
|
XSLoader::load('Linux::Unshare', $VERSION); |
39
|
|
|
|
|
|
|
|
40
|
1
|
50
|
|
1
|
0
|
1346
|
sub unshare_ns { return unshare(0x20000) ? 0 : -1; } |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
__END__ |