line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::IOLoop::ReadWriteProcess::CGroup::v1::PID; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
105
|
use Mojo::Base -base; |
|
15
|
|
|
|
|
29
|
|
|
15
|
|
|
|
|
105
|
|
4
|
|
|
|
|
|
|
|
5
|
15
|
|
|
15
|
|
2420
|
use constant {CURRENT_INTERFACE => 'pids.current', MAX_INTERFACE => 'pids.max'}; |
|
15
|
|
|
|
|
30
|
|
|
15
|
|
|
|
|
3581
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has cgroup => sub { Mojo::IOLoop::ReadWriteProcess::CGroup::v2->new }; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
0
|
201
|
sub current { shift->cgroup->_list(CURRENT_INTERFACE) } |
10
|
4
|
|
|
4
|
0
|
1460
|
sub max { shift->cgroup->_setget(MAX_INTERFACE, @_) } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=encoding utf-8 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Mojo::IOLoop::ReadWriteProcess::CGroup::v1::PID - CGroups v1 PID Controller. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use Mojo::IOLoop::ReadWriteProcess::CGroup::v1; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $cgroup = Mojo::IOLoop::ReadWriteProcess::CGroup::v1->new( name => "test" ); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$cgroup->pid->current; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
This module uses features that are only available on Linux, |
31
|
|
|
|
|
|
|
and requires cgroups and capability for unshare syscalls to achieve pid isolation. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 METHODS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
L inherits all methods from L and implements |
36
|
|
|
|
|
|
|
the following new ones. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 LICENSE |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Copyright (C) Ettore Di Giacinto. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
43
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 AUTHOR |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Ettore Di Giacinto Eedigiacinto@suse.comE |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |