--- /dev/null
+# Perl module for setting process limits
+#
+# (c) 2007 Pavel Charvat <pchar@ucw.cz>
+#
+# This software may be freely distributed and used according to the terms
+# of the GNU Lesser General Public License.
+#
+#
+#
+# Interface:
+# Sherlock::Filelock::fcntllock($handle, $type, $whence, $start, $len)
+#
+
+package Sherlock::Filelock;
+
+use 5.006;
+use strict;
+use warnings;
+
+require Exporter;
+require DynaLoader;
+
+our @ISA = qw(Exporter DynaLoader);
+unshift @DynaLoader::dl_library_path, "lib";
+
+# This allows declaration use Filelock ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+our %EXPORT_TAGS = ( 'all' => [ qw(
+
+) ] );
+
+our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+our @EXPORT = qw(
+);
+our $VERSION = '0.01';
+
+bootstrap Sherlock::Filelock $VERSION;
+
+# Preloaded methods go here.
+
+1;
+__END__
--- /dev/null
+/*
+ * PerlXS module for managing file locks
+ *
+ * (c) 2007 Pavel Charvat <pchar@ucw.cz>
+ */
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include <unistd.h>
+#include <fcntl.h>
+
+
+MODULE = Sherlock::Filelock PACKAGE = Sherlock::Filelock
+
+PROTOTYPES: ENABLED
+
+int
+fcntl_lock(IN int fd, IN int cmd, IN int type, IN int whence, IN int start, IN int len)
+CODE:
+ struct flock fl;
+ fl.l_type = type;
+ fl.l_whence = whence;
+ fl.l_start = start;
+ fl.l_len = len;
+
+ RETVAL = fcntl(fd, cmd, &fl);
+OUTPUT:
+ RETVAL
--- /dev/null
+Makefile
+Makefile.PL
+MANIFEST
+Fcntllock.pm
+Fcntllock.xs
+CVS/Entries
+CVS/Repository
+CVS/Root
+lib/Sherlock/.exists
+.cvsignore
--- /dev/null
+# Makefile for the Filelock Perl module (c) 2007 Pavel Chrvat <pchar@ucw.cz>
+
+DIRS+=lib/perl/Filelock/arch/auto/Sherlock/Filelock
+FILELOCK_DIR=lib/perl/Filelock
+
+PROGS+=$(o)/lib/perl/Filelock/Filelock.pm
+ifdef CONFIG_DARWIN
+SOEXT=bundle
+else
+SOEXT=so
+endif
+
+extras:: $(o)/lib/perl/Filelock/arch/auto/Sherlock/Filelock/Filelock.$(SOEXT)
+
+$(o)/lib/perl/Filelock/arch/auto/Sherlock/Filelock/Filelock.$(SOEXT): $(o)/$(FILELOCK_DIR)/Filelock.xs $(o)/$(FILELOCK_DIR)/Filelock.pm $(o)/$(FILELOCK_DIR)/Makefile
+ cd $(o)/$(FILELOCK_DIR) && $(MAKE) -f Makefile
+ cp $@ run/$(DATADIR)/
+
+$(o)/$(FILELOCK_DIR)/Makefile: $(o)/$(FILELOCK_DIR)/Makefile.PL
+ cd $(o)/$(FILELOCK_DIR) && perl Makefile.PL
+
+$(o)/$(FILELOCK_DIR)/Filelock.xs: $(s)/$(FILELOCK_DIR)/Filelock.xs
+ cp $^ $@
+
+$(o)/$(FILELOCK_DIR)/Makefile.PL: $(s)/$(FILELOCK_DIR)/Makefile.PL
+ cp $^ $@
--- /dev/null
+# Makefile for Perl MakeMaker (c) 2007 Pavel Charvat <pchar@ucw.cz>
+
+use ExtUtils::MakeMaker;
+WriteMakefile(
+ 'NAME' => 'Sherlock::Filelock',
+ 'VERSION_FROM' => 'Filelock.pm',
+ 'INST_LIB' => 'lib',
+ 'INST_ARCHLIB' => 'arch',
+);
ifdef CONFIG_UCW_PERL_ULIMIT
include $(s)/lib/perl/Ulimit/Makefile
endif
+
+ifdef CONFIG_UCW_PERL_FILELOCK
+include $(s)/lib/perl/Filelock/Makefile
+endif