… | |
… | |
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] |
|
|
283 | IO::AIO::min_fdlimit $nfd [EXPERIMENTAL] |
282 | |
284 | |
283 | IO::AIO::sendfile $ofh, $ifh, $offset, $count |
285 | IO::AIO::sendfile $ofh, $ifh, $offset, $count |
284 | IO::AIO::fadvise $fh, $offset, $len, $advice |
286 | IO::AIO::fadvise $fh, $offset, $len, $advice |
285 | IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]] |
287 | IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]] |
286 | IO::AIO::munmap $scalar |
288 | IO::AIO::munmap $scalar |
… | |
… | |
958 | |
960 | |
959 | Try to copy the I<file> (directories not supported as either source or |
961 | Try to copy the I<file> (directories not supported as either source or |
960 | destination) from C<$srcpath> to C<$dstpath> and call the callback with |
962 | destination) from C<$srcpath> to C<$dstpath> and call the callback with |
961 | a status of C<0> (ok) or C<-1> (error, see C<$!>). |
963 | a status of C<0> (ok) or C<-1> (error, see C<$!>). |
962 | |
964 | |
|
|
965 | Existing destination files will be truncated. |
|
|
966 | |
963 | This is a composite request that creates the destination file with |
967 | This is a composite request that creates the destination file with |
964 | mode 0200 and copies the contents of the source file into it using |
968 | mode 0200 and copies the contents of the source file into it using |
965 | C<aio_sendfile>, followed by restoring atime, mtime, access mode and |
969 | C<aio_sendfile>, followed by restoring atime, mtime, access mode and |
966 | uid/gid, in that order. |
970 | uid/gid, in that order. |
967 | |
971 | |
… | |
… | |
1076 | Scans a directory (similar to C<aio_readdir>) but additionally tries to |
1080 | Scans a directory (similar to C<aio_readdir>) but additionally tries to |
1077 | efficiently separate the entries of directory C<$path> into two sets of |
1081 | efficiently separate the entries of directory C<$path> into two sets of |
1078 | names, directories you can recurse into (directories), and ones you cannot |
1082 | names, directories you can recurse into (directories), and ones you cannot |
1079 | recurse into (everything else, including symlinks to directories). |
1083 | recurse into (everything else, including symlinks to directories). |
1080 | |
1084 | |
1081 | C<aio_scandir> is a composite request that creates of many sub requests_ |
1085 | C<aio_scandir> is a composite request that generates many sub requests. |
1082 | C<$maxreq> specifies the maximum number of outstanding aio requests that |
1086 | C<$maxreq> specifies the maximum number of outstanding aio requests that |
1083 | this function generates. If it is C<< <= 0 >>, then a suitable default |
1087 | this function generates. If it is C<< <= 0 >>, then a suitable default |
1084 | will be chosen (currently 4). |
1088 | will be chosen (currently 4). |
1085 | |
1089 | |
1086 | On error, the callback is called without arguments, otherwise it receives |
1090 | On error, the callback is called without arguments, otherwise it receives |
… | |
… | |
1479 | C<IO::AIO::FIEMAP_EXTENT_DATA_ENCRYPTED>, C<IO::AIO::FIEMAP_EXTENT_NOT_ALIGNED>, |
1483 | C<IO::AIO::FIEMAP_EXTENT_DATA_ENCRYPTED>, C<IO::AIO::FIEMAP_EXTENT_NOT_ALIGNED>, |
1480 | C<IO::AIO::FIEMAP_EXTENT_DATA_INLINE>, C<IO::AIO::FIEMAP_EXTENT_DATA_TAIL>, |
1484 | C<IO::AIO::FIEMAP_EXTENT_DATA_INLINE>, C<IO::AIO::FIEMAP_EXTENT_DATA_TAIL>, |
1481 | C<IO::AIO::FIEMAP_EXTENT_UNWRITTEN>, C<IO::AIO::FIEMAP_EXTENT_MERGED> or |
1485 | C<IO::AIO::FIEMAP_EXTENT_UNWRITTEN>, C<IO::AIO::FIEMAP_EXTENT_MERGED> or |
1482 | C<IO::AIO::FIEMAP_EXTENT_SHARED>. |
1486 | C<IO::AIO::FIEMAP_EXTENT_SHARED>. |
1483 | |
1487 | |
1484 | At the time of this writing (Linux 3.2), this requets is unreliable unless |
1488 | At the time of this writing (Linux 3.2), this request is unreliable unless |
1485 | C<$count> is C<undef>, as the kernel has all sorts of bugs preventing |
1489 | C<$count> is C<undef>, as the kernel has all sorts of bugs preventing |
1486 | it to return all extents of a range for files with large number of |
1490 | it to return all extents of a range for files with a large number of |
1487 | extents. The code works around all these issues if C<$count> is undef. |
1491 | extents. The code (only) works around all these issues if C<$count> is |
|
|
1492 | C<undef>. |
1488 | |
1493 | |
1489 | =item aio_group $callback->(...) |
1494 | =item aio_group $callback->(...) |
1490 | |
1495 | |
1491 | This is a very special aio request: Instead of doing something, it is a |
1496 | This is a very special aio request: Instead of doing something, it is a |
1492 | container for other aio requests, which is useful if you want to bundle |
1497 | container for other aio requests, which is useful if you want to bundle |
… | |
… | |
1605 | There are some caveats: when directories get renamed (or deleted), the |
1610 | There are some caveats: when directories get renamed (or deleted), the |
1606 | pathname string doesn't change, so will point to the new directory (or |
1611 | pathname string doesn't change, so will point to the new directory (or |
1607 | nowhere at all), while the directory fd, if available on the system, |
1612 | nowhere at all), while the directory fd, if available on the system, |
1608 | will still point to the original directory. Most functions accepting a |
1613 | will still point to the original directory. Most functions accepting a |
1609 | pathname will use the directory fd on newer systems, and the string on |
1614 | pathname will use the directory fd on newer systems, and the string on |
1610 | older systems. Some functions (such as realpath) will always rely on the |
1615 | older systems. Some functions (such as C<aio_realpath>) will always rely on |
1611 | string form of the pathname. |
1616 | the string form of the pathname. |
1612 | |
1617 | |
1613 | So this functionality is mainly useful to get some protection against |
1618 | So this functionality is mainly useful to get some protection against |
1614 | C<chdir>, to easily get an absolute path out of a relative path for future |
1619 | C<chdir>, to easily get an absolute path out of a relative path for future |
1615 | reference, and to speed up doing many operations in the same directory |
1620 | reference, and to speed up doing many operations in the same directory |
1616 | (e.g. when stat'ing all files in a directory). |
1621 | (e.g. when stat'ing all files in a directory). |
… | |
… | |
2063 | some "Advanced I/O" function not available to in Perl, without going the |
2068 | some "Advanced I/O" function not available to in Perl, without going the |
2064 | "Asynchronous I/O" route. Many of these have an asynchronous C<aio_*> |
2069 | "Asynchronous I/O" route. Many of these have an asynchronous C<aio_*> |
2065 | counterpart. |
2070 | counterpart. |
2066 | |
2071 | |
2067 | =over 4 |
2072 | =over 4 |
|
|
2073 | |
|
|
2074 | =item $numfd = IO::AIO::get_fdlimit |
|
|
2075 | |
|
|
2076 | This function is I<EXPERIMENTAL> and subject to change. |
|
|
2077 | |
|
|
2078 | Tries to find the current file descriptor limit and returns it, or |
|
|
2079 | C<undef> and sets C<$!> in case of an error. The limit is one larger than |
|
|
2080 | the highest valid file descriptor number. |
|
|
2081 | |
|
|
2082 | =item IO::AIO::min_fdlimit [$numfd] |
|
|
2083 | |
|
|
2084 | This function is I<EXPERIMENTAL> and subject to change. |
|
|
2085 | |
|
|
2086 | Try to increase the current file descriptor limit(s) to at least C<$numfd> |
|
|
2087 | by changing the soft or hard file descriptor resource limit. If C<$numfd> |
|
|
2088 | is missing, it will try to set a very high limit, although this is not |
|
|
2089 | recommended when you know the actual minimum that you require. |
|
|
2090 | |
|
|
2091 | If the limit cannot be raised enough, the function makes a best-effort |
|
|
2092 | attempt to increase the limit as much as possible, using various |
|
|
2093 | tricks, while still failing. You can query the resulting limit using |
|
|
2094 | C<IO::AIO::get_fdlimit>. |
|
|
2095 | |
|
|
2096 | If an error occurs, returns C<undef> and sets C<$!>, otherwise returns |
|
|
2097 | true. |
2068 | |
2098 | |
2069 | =item IO::AIO::sendfile $ofh, $ifh, $offset, $count |
2099 | =item IO::AIO::sendfile $ofh, $ifh, $offset, $count |
2070 | |
2100 | |
2071 | Calls the C<eio_sendfile_sync> function, which is like C<aio_sendfile>, |
2101 | Calls the C<eio_sendfile_sync> function, which is like C<aio_sendfile>, |
2072 | but is blocking (this makes most sense if you know the input data is |
2102 | but is blocking (this makes most sense if you know the input data is |