File Coverage

blib/lib/Linux/Fanotify.pm
Criterion Covered Total %
statement 10 16 62.5
branch n/a
condition n/a
subroutine 4 8 50.0
pod 1 1 100.0
total 15 25 60.0


line stmt bran cond sub pod time code
1             # Copyright (c) 2014 Collax GmbH
2             package Linux::Fanotify;
3              
4 4     4   85156 use 5.006001;
  4         15  
5 4     4   18 use strict;
  4         7  
  4         1451  
6              
7             require Exporter;
8             require DynaLoader;
9              
10             our @ISA = qw(Exporter DynaLoader);
11              
12             our %EXPORT_TAGS = (
13             consts => [qw(
14             FAN_ACCESS
15             FAN_MODIFY
16             FAN_CLOSE_WRITE
17             FAN_CLOSE_NOWRITE
18             FAN_OPEN
19              
20             FAN_Q_OVERFLOW
21              
22             FAN_OPEN_PERM
23             FAN_ACCESS_PERM
24              
25             FAN_ONDIR
26              
27             FAN_EVENT_ON_CHILD
28              
29             FAN_CLOSE
30              
31             FAN_CLOEXEC
32             FAN_NONBLOCK
33              
34             FAN_CLASS_NOTIF
35             FAN_CLASS_CONTENT
36             FAN_CLASS_PRE_CONTENT
37             FAN_ALL_CLASS_BITS
38              
39             FAN_UNLIMITED_QUEUE
40             FAN_UNLIMITED_MARKS
41              
42             FAN_ALL_INIT_FLAGS
43              
44             FAN_MARK_ADD
45             FAN_MARK_REMOVE
46             FAN_MARK_DONT_FOLLOW
47             FAN_MARK_ONLYDIR
48             FAN_MARK_MOUNT
49             FAN_MARK_IGNORED_MASK
50             FAN_MARK_IGNORED_SURV_MODIFY
51             FAN_MARK_FLUSH
52              
53             FAN_ALL_MARK_FLAGS
54              
55             FAN_ALL_EVENTS
56              
57             FAN_ALL_PERM_EVENTS
58              
59             FAN_ALL_OUTGOING_EVENTS
60              
61             FANOTIFY_METADATA_VERSION
62              
63             FAN_ALLOW
64             FAN_DENY
65             FAN_NOFD
66             )],
67             funcs => [qw(
68             fanotify_init
69             fanotify_mark
70             fanotify_read
71             fanotify_write
72             )],
73             );
74              
75             our @EXPORT_OK = map {@{$_}} values %EXPORT_TAGS;
76              
77             bootstrap Linux::Fanotify;
78              
79             ################################################################################
80              
81             our $default_response = -1;
82              
83             sub init {
84 0     0 1 0 my $class = shift;
85 0         0 return fanotify_init(@_);
86             }
87              
88             package Linux::Fanotify::FanotifyGroup;
89              
90             our $autoclose = 1;
91              
92             sub new {
93 1     1   3505 my $class = shift;
94 1         23 return Linux::Fanotify::fanotify_init(@_);
95             }
96              
97             sub mark {
98 0     0     return Linux::Fanotify::fanotify_mark(@_);
99             }
100              
101             sub read {
102 0     0     return Linux::Fanotify::fanotify_read(@_);
103             }
104              
105             package Linux::Fanotify::Event;
106              
107             our $autoclose = 1;
108              
109 4     4   5521 use overload '""' => sub { my $self = shift; return $self->_stringify(); };
  4     0   4265  
  4         39  
  0         0  
  0         0  
110              
111             1;
112              
113             __END__