… | |
… | |
1580 | C<IO::AIO::MAP_NORESERVE>, C<IO::AIO::MAP_POPULATE> or |
1580 | C<IO::AIO::MAP_NORESERVE>, C<IO::AIO::MAP_POPULATE> or |
1581 | C<IO::AIO::MAP_NONBLOCK> |
1581 | C<IO::AIO::MAP_NONBLOCK> |
1582 | |
1582 | |
1583 | If C<$fh> is C<undef>, then a file descriptor of C<-1> is passed. |
1583 | If C<$fh> is C<undef>, then a file descriptor of C<-1> is passed. |
1584 | |
1584 | |
|
|
1585 | Example: |
|
|
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 | |
1587 | Removes a previous mmap and undefines the C<$scalar>. |
1600 | Removes a previous mmap and undefines the C<$scalar>. |
1588 | |
1601 | |
1589 | =item IO::AIO::mlockall $flags |
1602 | =item IO::AIO::mlockall $flags |