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.35 by root, Tue Jul 12 10:51:09 2005 UTC

50package Linux::AIO; 50package Linux::AIO;
51 51
52use base 'Exporter'; 52use base 'Exporter';
53 53
54BEGIN { 54BEGIN {
55 $VERSION = 1.71; 55 $VERSION = 1.72;
56 56
57 @EXPORT = qw(aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink 57 @EXPORT = qw(aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink
58 aio_fsync aio_fdatasync aio_readahead); 58 aio_fsync aio_fdatasync aio_readahead);
59 @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs); 59 @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs);
60 60
138 138
139Example: 139Example:
140 140
141 aio_open "/etc/passwd", O_RDONLY, 0, sub { 141 aio_open "/etc/passwd", O_RDONLY, 0, sub {
142 if ($_[0] >= 0) { 142 if ($_[0] >= 0) {
143 open my $fh, "<&$_[0]"; # create a copy for perl 143 open my $fh, "<&=$_[0]";
144 aio_close $_[0], sub { }; # close the aio handle
145 print "open successful, fh is $fh\n"; 144 print "open successful, fh is $fh\n";
146 ... 145 ...
147 } else { 146 } else {
148 die "open failed: $!\n"; 147 die "open failed: $!\n";
149 } 148 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines