Commit 56c26e73 authored by Nicholas Bamber's avatar Nicholas Bamber

[svn-upgrade] new version libio-aio-perl (3.71)

parent 1a2f1abf
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,9 +3,10 @@ MANIFEST
COPYING
Changes
Makefile.PL
schmorp.h
AIO.pm
AIO.xs
xthread.h
bin/treescan
t/00_load.t
t/01_stat.t
t/02_read.t
......@@ -15,10 +16,16 @@ t/05_readdir.t
t/06_group.t
t/07_feeder.t
t/aio_test_common.pm
libeio/xthread.h
libeio/eio.h
libeio/eio.c
libeio/libeio.m4
libeio/config.h.in
configure.ac
configure
autogen.sh
typemap
genac
autoconf.pm
autoconf/configure.ac
autoconf/configure
autoconf/config.h.in
META.yml Module meta-data (added by MakeMaker)
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: IO-AIO
version: 2.4
version_from: AIO.pm
installdirs: site
--- #YAML:1.0
name: IO-AIO
version: 3.71
abstract: ~
author: []
license: unknown
distribution_type: module
configure_requires:
ExtUtils::MakeMaker: 0
build_requires:
ExtUtils::MakeMaker: 0
requires:
distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.30
common::sense: 0
no_index:
directory:
- t
- inc
generated_by: ExtUtils::MakeMaker version 6.56
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
use 5.008002;
use ExtUtils::MakeMaker;
use Config;
require "autoconf.pm";
if ($^O =~ /win32/i or $^O =~ /mswin/) {
# configuration on windows is hardcoded - as always
......@@ -17,25 +17,38 @@ if ($^O =~ /win32/i or $^O =~ /mswin/) {
} else {
$INC = "";
$LIBS = ['-lpthread -lrt', '-lpthread', '-lpthreads', '-lpthreadVC2', ''];
$LIBS = ['-lpthread', '-lpthreads', '-lpthreadVC2', ''];
if ($^O =~ /freebsd/i) {
if ($^O =~ /bsd/i) {
print <<EOF;
This package seems to deadlock or otherwise misbehave under FreeBSD. As
documentation on FreeBSD threading is sorely lacking and confusing, I'll
just call FreeBSD broken with regards to threading.
If you find out whats wrong, please tell me.
Some people had luck with using OPTIMIZE=-O instead of -O2, so you might
want to try that.
If you have problems with deadlocks or crashes on your system,
make sure your perl has been linked with -lpthread (you might try
LD_PRELOAD=/path/to/libpthread.so as a workaround). Also, pthread support
under many BSDs is not the best - before reporting a bug in this module,
make sure it's not an OS bug.
EOF
}
autoconf::run_script()
and die "\nconfigure failed, check it's output above and autoconf/config.log\n\n";
{
local %ENV = %ENV;
while (my ($k, $v) = each %Config) {
$ENV{$k} = $v;
}
$ENV{MAKE} = $Config{make};
$ENV{SHELL} = $Config{sh};
$ENV{CC} = $Config{cc};
$ENV{CPPFLAGS} = $Config{cppflags};
$ENV{CFLAGS} = $Config{ccflags};
$ENV{LDFLAGS} = $Config{ldflags};
$ENV{LINKER} = $Config{ld}; # nonstandard
system $ENV{SHELL}, -c => "./configure --prefix \Q$Config{prefixexp}\E"
and exit $? >> 8;
}
}
if ($^O =~ /linux/ && $Config{usemymalloc} eq "y") {
......@@ -64,14 +77,21 @@ my $mm = MM->new({
COMPRESS => 'gzip -9v',
SUFFIX => '.gz',
},
depend => {
"AIO.c" => "libeio/eio.h libeio/xthread.h libeio/eio.c libeio/config.h",
},
NAME => "IO::AIO",
VERSION_FROM => "AIO.pm",
INC => $INC,
LIBS => $LIBS,
EXE_FILES => ["bin/treescan"],
PM => {
'AIO.pm' => '$(INST_LIBDIR)/AIO.pm',
},
clean => { FILES => "autoconf/config.h autoconf/config.log autoconf/config.status" },
PREREQ_PM => {
"common::sense" => 0,
},
clean => { FILES => "libeio/config.h libeio/config.log libeio/config.status" },
});
$mm->flush;
......
This diff is collapsed.
package autoconf;
# I plan to improve this and make it a standalone ExtUtils::Autoconf module,
# but right now it just runs an external configure script.
use Config;
sub run_script(;$$) {
my ($wd, $file) = @_;
$wd ||= "autoconf";
$script ||= "./configure";
local %ENV = %ENV;
while (my ($k, $v) = each %Config) {
$ENV{$k} = $v;
}
$ENV{MAKE} = $Config{make};
$ENV{SHELL} = $Config{sh};
$ENV{CC} = $Config{cc};
$ENV{CPPFLAGS} = $Config{cppflags};
$ENV{CFLAGS} = $Config{ccflags};
$ENV{LDFLAGS} = $Config{ldflags};
$ENV{LIBS} = "";
$ENV{LINKER} = $Config{ld}; # nonstandard
my $status = system $ENV{SHELL}, -c => "cd \Q$wd\E && \Q$script\E --prefix \Q$Config{prefixexp}\E";
$status
}
1
cd autoconf || exit 69
autoconf
autoheader
#!/opt/bin/perl
# inspired by treescan by Jamie Lokier <jamie@imbolc.ucc.ie>
# about 40% faster than the original version (on my fs and raid :)
use strict;
use Getopt::Long;
use IO::AIO;
our $VERSION = $IO::AIO::VERSION;
Getopt::Long::Configure ("bundling", "no_ignore_case", "require_order", "auto_help", "auto_version");
my ($opt_silent, $opt_print0, $opt_stat, $opt_nodirs, $opt_nofiles);
GetOptions
"quiet|q" => \$opt_silent,
"print0|0" => \$opt_print0,
"stat|s" => \$opt_stat,
"dirs|d" => \$opt_nofiles,
"files|f" => \$opt_nodirs,
or die "Usage: try $0 --help";
@ARGV = "." unless @ARGV;
sub printfn {
my ($prefix, $files, $suffix) = @_;
if ($opt_print0) {
print map "$prefix$_$suffix\0", @$files;
} elsif (!$opt_silent) {
print map "$prefix$_$suffix\n", @$files;
}
}
sub scan {
my ($path) = @_;
$path .= "/";
aioreq_pri -1;
aio_scandir $path, 8, sub {
my ($dirs, $files) = @_;
printfn "", [$path] unless $opt_nodirs;
printfn $path, $files unless $opt_nofiles;
if ($opt_stat) {
aio_lstat "$path$_" for @$files;
}
&scan ("$path$_") for @$dirs;
};
}
IO::AIO::max_outstanding 64;
IO::AIO::min_parallel 32;
for my $seed (@ARGV) {
$seed =~ s/\/+$//;
aio_lstat "$seed/.", sub {
if ($_[0]) {
print STDERR "$seed: $!\n";
} elsif (-d _) {
scan $seed;
} else {
printfn "", $seed, "/";
}
};
}
IO::AIO::flush;
This diff is collapsed.
AC_PREREQ(2.59)
AC_INIT
AC_CONFIG_SRCDIR([libeio/eio.h])
AC_CONFIG_HEADERS([libeio/config.h])
AC_PROG_CC
m4_include([libeio/libeio.m4])
AC_OUTPUT
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* fdatasync(2) is available */
#undef HAVE_FDATASYNC
/* futimes(2) is available */
#undef HAVE_FUTIMES
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* posix_fadvise(2) is available */
#undef HAVE_POSIX_FADVISE
/* posix_madvise(2) is available */
#undef HAVE_POSIX_MADVISE
/* pread(2) and pwrite(2) are available */
#undef HAVE_PREADWRITE
/* readahead(2) is available (linux) */
#undef HAVE_READAHEAD
/* readdir_r is available */
#undef HAVE_READDIR_R
/* sendfile(2) is available and supported */
#undef HAVE_SENDFILE
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* sync_file_range(2) is available */
#undef HAVE_SYNC_FILE_RANGE
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* utimes(2) is available */
#undef HAVE_UTIMES
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
......@@ -30,5 +72,14 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -61,7 +61,7 @@ aio_stat *PWD, sub {
pcb;
aio_close *PWD, sub {
print $_[0] ? "not ok" : "ok", " 10\n";
print $_[0] ? "not ok" : "ok", " 10 # <@_>\n";
};
pcb;
......
......@@ -7,7 +7,7 @@ use FindBin;
use lib "$FindBin::Bin";
use aio_test_common;
BEGIN { plan tests => 13 }
BEGIN { plan tests => 12 }
IO::AIO::min_parallel 2;
......@@ -43,18 +43,20 @@ pcb;
# write to file open for reading
ok(open(F, $some_file)) or die $!;
aio_write *F, 0, 10, "foobarbaz.", 0, sub {
my $written = shift;
ok($written < 0);
ok($! == EBADF);
};
eval { aio_write *F, 0, 10, "foobarbaz.", 0, sub { ok (0) } };
ok ($@ =~ /mode mismatch/);
pcb;
close F;
aio_symlink "\\test\\", $some_link, sub {
ok (!$_[0]);
ok ("\\test\\" eq readlink $some_link);
if ($^O eq "cygwin") {
ok (1);
ok (1);
} else {
ok (!$_[0]);
ok ("\\test\\" eq readlink $some_link);
}
};
pcb;
unlink $some_link;
......
......@@ -5,7 +5,7 @@ use IO::AIO;
# this is a lame test, but....
BEGIN { plan tests => 8 }
BEGIN { plan tests => 12 }
my %f;
ok ((opendir my $dir, "."), 1, "$!");
......@@ -39,7 +39,7 @@ aio_scandir ".", 0, sub {
my $ok = 1;
$ok &&= delete $x{$_} for (@{$_[0]}, @{$_[1]});
ok ($ok);
ok (!scalar keys %x);
ok (!keys %x);
} else {
ok (0,1,"$!");
}
......@@ -47,5 +47,31 @@ aio_scandir ".", 0, sub {
IO::AIO::poll while IO::AIO::nreqs;
my $entries1;
aio_readdirx ".", IO::AIO::READDIR_STAT_ORDER, sub {
$entries1 = shift;
ok (! ! $entries1);
};
IO::AIO::poll while IO::AIO::nreqs;
aio_readdirx ".", IO::AIO::READDIR_STAT_ORDER | IO::AIO::READDIR_DENTS, sub {
my $entries2 = shift;
ok (! ! $entries2);
if ($^O eq "cygwin") {
# sigh...
$entries1 = [ sort @$entries1 ];
$entries2 = [ sort { $a->[0] cmp $b->[0] } @$entries2 ];
}
ok ((join "\x00", @$entries1) eq (join "\x00", map $_->[0], @$entries2));
ok (!grep $entries2->[$_ - 1][2] > $entries2->[$_][2], 1 .. $#$entries2);
};
IO::AIO::poll while IO::AIO::nreqs;
ok (1);
......@@ -24,11 +24,11 @@ $grp->feed (sub {
});
});
print $cn2 == 5 ? "" : "not ", "ok 2\n";
print $cn3 == 0 ? "" : "not ", "ok 3\n";
print $cn2 == 5 ? "" : "not ", "ok 2 # $cn2 == 5\n";
print $cn3 == 0 ? "" : "not ", "ok 3 # $cn3 == 0\n";
IO::AIO::poll while IO::AIO::nreqs;
print $cn2 == 10 ? "" : "not ", "ok 5\n";
print $cn3 == 10 ? "" : "not ", "ok 6\n";
print $cn2 == 10 ? "" : "not ", "ok 5 # $cn2 == 10\n";
print $cn3 == 10 ? "" : "not ", "ok 6 # $cn2 == 10\n";
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment