/usr/lib/x86_64-linux-gnu/perl5/5.24/File/FcntlLock/Core.pm is in libfile-fcntllock-perl 0.22-3+b2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | # -*- cperl -*-
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
# Copyright (C) 2002-2014 Jens Thoms Toerring <jt@toerring.de>
# Base class for the three modules for file locking using fcntl(2)
package File::FcntlLock::Core;
use 5.006;
use strict;
use warnings;
use POSIX;
use Carp;
use base qw( File::FcntlLock::Errors Exporter );
our $VERSION = '0.22';
# Items to export into callers namespace by default.
our @EXPORT = qw( F_GETLK F_SETLK F_SETLKW
F_RDLCK F_WRLCK F_UNLCK
SEEK_SET SEEK_CUR SEEK_END );
###########################################################
#
# Make our exports exportable by child classes
sub import
{
File::FcntlLock::Core->export_to_level( 1, @_ );
}
###########################################################
# Method for creating the object
sub new {
my $inv = shift;
my $pkg = ref( $inv ) || $inv;
my $self = { l_type => F_RDLCK,
l_whence => SEEK_SET,
l_start => 0,
l_len => 0,
l_pid => 0,
errno => undef,
error_message => undef };
if ( @_ % 2 ) {
carp "Missing value in key-value initializer list " .
"in call of new method";
return;
}
while ( @_ ) {
my $key = shift;
no strict 'refs';
unless ( defined &$key ) {
carp "Flock structure has no '$key' member " .
"in call of new method";
return;
}
&$key( $self, shift );
use strict 'refs';
}
bless $self, $pkg;
}
###########################################################
# Method for setting or querying the 'l_type' property
sub l_type {
my $self = shift;
if ( @_ ) {
my $l_type = shift;
unless ( $l_type == F_RDLCK
or $l_type == F_WRLCK
or $l_type == F_UNLCK ) {
carp "Invalid argument in call of l_type method";
return;
}
$self->{ l_type } = $l_type;
}
return $self->{ l_type };
}
###########################################################
# Method for setting or querying the 'l_whence' property
sub l_whence {
my $self = shift;
if ( @_ ) {
my $l_whence = shift;
unless ( $l_whence == SEEK_SET
or $l_whence == SEEK_CUR
or $l_whence == SEEK_END ) {
carp "Invalid argument in call of l_whence method";
return;
}
$self->{ l_whence } = $l_whence;
}
return $self->{ l_whence };
}
###########################################################
# Method to set or query of the 'l_start' property
sub l_start {
my $self = shift;
$self->{ l_start } = shift if @_;
return $self->{ l_start };
}
###########################################################
# Method to set or query the 'l_len' property
sub l_len {
my $self = shift;
$self->{ l_len } = shift if @_;
return $self->{ l_len };
}
###########################################################
# Method to query the 'l_pid' property
sub l_pid {
return shift->{ l_pid };
}
1;
# Local variables:
# tab-width: 4
# indent-tabs-mode: nil
# End:
|