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.276 by root, Fri Sep 22 05:24:41 2017 UTC vs.
Revision 1.278 by root, Sun Oct 1 07:24:34 2017 UTC

277 IO::AIO::idle_timeout $seconds 277 IO::AIO::idle_timeout $seconds
278 IO::AIO::max_outstanding $maxreqs 278 IO::AIO::max_outstanding $maxreqs
279 IO::AIO::nreqs 279 IO::AIO::nreqs
280 IO::AIO::nready 280 IO::AIO::nready
281 IO::AIO::npending 281 IO::AIO::npending
282 $nfd = IO::AIO::get_fdlimit [EXPERIMENTAL]
282 IO::AIO::min_fdlimit $nfd; 283 IO::AIO::min_fdlimit $nfd [EXPERIMENTAL]
283 284
284 IO::AIO::sendfile $ofh, $ifh, $offset, $count 285 IO::AIO::sendfile $ofh, $ifh, $offset, $count
285 IO::AIO::fadvise $fh, $offset, $len, $advice 286 IO::AIO::fadvise $fh, $offset, $len, $advice
286 IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]] 287 IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]]
287 IO::AIO::munmap $scalar 288 IO::AIO::munmap $scalar
1079Scans a directory (similar to C<aio_readdir>) but additionally tries to 1080Scans a directory (similar to C<aio_readdir>) but additionally tries to
1080efficiently separate the entries of directory C<$path> into two sets of 1081efficiently separate the entries of directory C<$path> into two sets of
1081names, directories you can recurse into (directories), and ones you cannot 1082names, directories you can recurse into (directories), and ones you cannot
1082recurse into (everything else, including symlinks to directories). 1083recurse into (everything else, including symlinks to directories).
1083 1084
1084C<aio_scandir> is a composite request that creates of many sub requests_ 1085C<aio_scandir> is a composite request that generates many sub requests.
1085C<$maxreq> specifies the maximum number of outstanding aio requests that 1086C<$maxreq> specifies the maximum number of outstanding aio requests that
1086this function generates. If it is C<< <= 0 >>, then a suitable default 1087this function generates. If it is C<< <= 0 >>, then a suitable default
1087will be chosen (currently 4). 1088will be chosen (currently 4).
1088 1089
1089On error, the callback is called without arguments, otherwise it receives 1090On error, the callback is called without arguments, otherwise it receives
1482C<IO::AIO::FIEMAP_EXTENT_DATA_ENCRYPTED>, C<IO::AIO::FIEMAP_EXTENT_NOT_ALIGNED>, 1483C<IO::AIO::FIEMAP_EXTENT_DATA_ENCRYPTED>, C<IO::AIO::FIEMAP_EXTENT_NOT_ALIGNED>,
1483C<IO::AIO::FIEMAP_EXTENT_DATA_INLINE>, C<IO::AIO::FIEMAP_EXTENT_DATA_TAIL>, 1484C<IO::AIO::FIEMAP_EXTENT_DATA_INLINE>, C<IO::AIO::FIEMAP_EXTENT_DATA_TAIL>,
1484C<IO::AIO::FIEMAP_EXTENT_UNWRITTEN>, C<IO::AIO::FIEMAP_EXTENT_MERGED> or 1485C<IO::AIO::FIEMAP_EXTENT_UNWRITTEN>, C<IO::AIO::FIEMAP_EXTENT_MERGED> or
1485C<IO::AIO::FIEMAP_EXTENT_SHARED>. 1486C<IO::AIO::FIEMAP_EXTENT_SHARED>.
1486 1487
1487At the time of this writing (Linux 3.2), this requets is unreliable unless 1488At the time of this writing (Linux 3.2), this request is unreliable unless
1488C<$count> is C<undef>, as the kernel has all sorts of bugs preventing 1489C<$count> is C<undef>, as the kernel has all sorts of bugs preventing
1489it to return all extents of a range for files with large number of 1490it to return all extents of a range for files with a large number of
1490extents. The code works around all these issues if C<$count> is undef. 1491extents. The code (only) works around all these issues if C<$count> is
1492C<undef>.
1491 1493
1492=item aio_group $callback->(...) 1494=item aio_group $callback->(...)
1493 1495
1494This is a very special aio request: Instead of doing something, it is a 1496This is a very special aio request: Instead of doing something, it is a
1495container for other aio requests, which is useful if you want to bundle 1497container for other aio requests, which is useful if you want to bundle
1608There are some caveats: when directories get renamed (or deleted), the 1610There are some caveats: when directories get renamed (or deleted), the
1609pathname string doesn't change, so will point to the new directory (or 1611pathname string doesn't change, so will point to the new directory (or
1610nowhere at all), while the directory fd, if available on the system, 1612nowhere at all), while the directory fd, if available on the system,
1611will still point to the original directory. Most functions accepting a 1613will still point to the original directory. Most functions accepting a
1612pathname will use the directory fd on newer systems, and the string on 1614pathname will use the directory fd on newer systems, and the string on
1613older systems. Some functions (such as realpath) will always rely on the 1615older systems. Some functions (such as C<aio_realpath>) will always rely on
1614string form of the pathname. 1616the string form of the pathname.
1615 1617
1616So this functionality is mainly useful to get some protection against 1618So this functionality is mainly useful to get some protection against
1617C<chdir>, to easily get an absolute path out of a relative path for future 1619C<chdir>, to easily get an absolute path out of a relative path for future
1618reference, and to speed up doing many operations in the same directory 1620reference, and to speed up doing many operations in the same directory
1619(e.g. when stat'ing all files in a directory). 1621(e.g. when stat'ing all files in a directory).
2069 2071
2070=over 4 2072=over 4
2071 2073
2072=item $numfd = IO::AIO::get_fdlimit 2074=item $numfd = IO::AIO::get_fdlimit
2073 2075
2076This function is I<EXPERIMENTAL> and subject to change.
2077
2074Tries to find the current file descriptor limit and returns it, or 2078Tries to find the current file descriptor limit and returns it, or
2075C<undef> and sets C<$!> in case of an error. The limit is one larger than 2079C<undef> and sets C<$!> in case of an error. The limit is one larger than
2076the highest valid file descriptor number. 2080the highest valid file descriptor number.
2077 2081
2078=item IO::AIO::min_fdlimit [$numfd] 2082=item IO::AIO::min_fdlimit [$numfd]
2083
2084This function is I<EXPERIMENTAL> and subject to change.
2079 2085
2080Try to increase the current file descriptor limit(s) to at least C<$numfd> 2086Try to increase the current file descriptor limit(s) to at least C<$numfd>
2081by changing the soft or hard file descriptor resource limit. If C<$numfd> 2087by changing the soft or hard file descriptor resource limit. If C<$numfd>
2082is missing, it will try to set a very high limit, although this is not 2088is missing, it will try to set a very high limit, although this is not
2083recommended when you know the actual minimum that you require. 2089recommended when you know the actual minimum that you require.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines