File: README

package info (click to toggle)
libfile-fcntllock-perl 0.22-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 144 kB
  • ctags: 30
  • sloc: perl: 298; ansic: 116; makefile: 2
file content (86 lines) | stat: -rw-r--r-- 3,280 bytes parent folder | download | duplicates (2)
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
File::FcntlLock
===============

File::FcntlLock is a module to do file locking in an object oriented
fashion using the fcntl(2) system call. This allows locks on parts of
a file as well as on the whole file and overcomes some known problems
with flock(2), on which Perls flock() function is based per default.

Since version 0.15 there three slightly different ways this can be done
with using this package. Per default a method is used where a shared
library build creation of the package is called from the Perl code to
invoke the fcntl(2) system function. This method can also be used by
employing the File::FcntlLock::XS module (which basically an alias for
File::FcntlLock). Two further methods instead use calls of the Perl
fcntl() function. In both cases at some time a C program must be run
to determine the binary layout of the C flock struct used by fcntl()
for locking. For the one package, File::FcntlLock::Pure, this is done
while making the package. For the other, File::FcntlLock::Inline, this
happens each time the package is loaded (e.g. wih the 'use' function).
Of course, for this to work a C compiler must be installed on the
system!

Unfortunately, there seem to be a few 32-bit systems where the off_t
type, used in the flock struct, is a 64-bit integer but which use a
Perl version that hasn't 64-bit support enabled. On these systems the
'q' format for Perl's pack() and unpack() function isn't available and
thus a "pure Perl" approach is thus not possible. On such systems the
File::FcntlLock::Pure and File::FcntlLock::Inline modules won't get
installed.


PORTABILITY

To use the module the system must support the fcntl() system call
which probably will restrict its use to POSIX compliant systems.


INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install


DEPENDENCIES

The module requires the following other modules:

  POSIX, Errno, Carp, Exporter, DynaLoader

To install the module(s) a C compiler must be available and the
system must support the use of shared libraries (or DLLs). For
File::FcntlFlock::Inline the C compiler must also be available when
the module is used. The installation of the File::FcntlLock::Pure
and File::FcntlLock::Inline modules require that the Perl pack()
and unpack() function support the 'q' format if the off_t type on
the system is 64-bit wide.


ACKNOWLEDGMENTS

Thanks to Mark Jason Dominus and Benjamin Goldberg for helpful discus-
sions, code examples and encouragement. Glenn Herteg pointed out several
problems and also helped improve the documentation. Julian Moreno Patino
helped correcting the documentation and pointed out problems arising on
GNU Hurd (which seems to have only very rudimentary support for locking
with fcntl(2), at least at that time). Niko Tyni and Guillem Jover
encouraged and helped with implementing alternatives to a XS-only
approach which hopefully will make the module more useful under certain
circumstances.

AUTHOR

Jens Thoms Toerring <jt@toerring.de>


COPYRIGHT AND LICENCE

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>
                                            http://toerring.de