ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Linux-AIO/AIO.pm
(Generate patch)

Comparing Linux-AIO/AIO.pm (file contents):
Revision 1.34 by root, Sun Jul 10 17:07:34 2005 UTC vs.
Revision 1.37 by root, Wed Feb 1 23:47:26 2006 UTC

4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use Linux::AIO; 7 use Linux::AIO;
8 8
9 # This module has been mostly superseded by IO::AIO.
10
9=head1 DESCRIPTION 11=head1 DESCRIPTION
12
13I<This module has been mostly superseded by IO::AIO, which is API
14compatible.>
10 15
11This module implements asynchronous I/O using the means available to Linux 16This module implements asynchronous I/O using the means available to Linux
12- clone. It does not hook into the POSIX aio_* functions because Linux 17- clone. It does not hook into the POSIX aio_* functions because Linux
13does not yet support these in the kernel (even as of 2.6.12, only O_DIRECT 18does not yet support these in the kernel (even as of 2.6.12, only O_DIRECT
14files are supported) and even if, it would only allow aio_read and write, 19files are supported) and even if, it would only allow aio_read and write,
50package Linux::AIO; 55package Linux::AIO;
51 56
52use base 'Exporter'; 57use base 'Exporter';
53 58
54BEGIN { 59BEGIN {
55 $VERSION = 1.71; 60 $VERSION = 1.9;
56 61
57 @EXPORT = qw(aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink 62 @EXPORT = qw(aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink
58 aio_fsync aio_fdatasync aio_readahead); 63 aio_fsync aio_fdatasync aio_readahead);
59 @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs); 64 @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs);
60 65
138 143
139Example: 144Example:
140 145
141 aio_open "/etc/passwd", O_RDONLY, 0, sub { 146 aio_open "/etc/passwd", O_RDONLY, 0, sub {
142 if ($_[0] >= 0) { 147 if ($_[0] >= 0) {
143 open my $fh, "<&$_[0]"; # create a copy for perl 148 open my $fh, "<&=$_[0]";
144 aio_close $_[0], sub { }; # close the aio handle
145 print "open successful, fh is $fh\n"; 149 print "open successful, fh is $fh\n";
146 ... 150 ...
147 } else { 151 } else {
148 die "open failed: $!\n"; 152 die "open failed: $!\n";
149 } 153 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines