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

Comparing IO-AIO/AIO.pm (file contents):
Revision 1.176 by root, Sun Jan 10 23:05:11 2010 UTC vs.
Revision 1.178 by root, Sun Jan 10 23:10:58 2010 UTC

168use common::sense; 168use common::sense;
169 169
170use base 'Exporter'; 170use base 'Exporter';
171 171
172BEGIN { 172BEGIN {
173 our $VERSION = '3.5'; 173 our $VERSION = '3.6';
174 174
175 our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close 175 our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close
176 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx 176 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx
177 aio_scandir aio_symlink aio_readlink aio_sync aio_fsync 177 aio_scandir aio_symlink aio_readlink aio_sync aio_fsync
178 aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead 178 aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead
1580C<IO::AIO::MAP_NORESERVE>, C<IO::AIO::MAP_POPULATE> or 1580C<IO::AIO::MAP_NORESERVE>, C<IO::AIO::MAP_POPULATE> or
1581C<IO::AIO::MAP_NONBLOCK> 1581C<IO::AIO::MAP_NONBLOCK>
1582 1582
1583If C<$fh> is C<undef>, then a file descriptor of C<-1> is passed. 1583If C<$fh> is C<undef>, then a file descriptor of C<-1> is passed.
1584 1584
1585Example:
1586
1587 use Digest::MD5;
1588 use IO::AIO;
1589
1590 open my $fh, "<verybigfile"
1591 or die "$!";
1592
1593 IO::AIO::mmap my $data, -s $fh, IO::AIO::PROT_READ, IO::AIO::MAP_SHARED, $fh
1594 or die "verybigfile: $!";
1595
1596 my $fast_md5 = md5 $data;
1597
1585=item IO::AIO::munmap $scalar 1598=item IO::AIO::munmap $scalar
1586 1599
1587Removes a previous mmap and undefines the C<$scalar>. 1600Removes a previous mmap and undefines the C<$scalar>.
1588 1601
1589=item IO::AIO::mlockall $flags 1602=item IO::AIO::mlockall $flags

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines