… | |
… | |
687 | array-ref with the filenames. |
687 | array-ref with the filenames. |
688 | |
688 | |
689 | |
689 | |
690 | =item aio_readdirx $pathname, $flags, $callback->($entries, $flags) |
690 | =item aio_readdirx $pathname, $flags, $callback->($entries, $flags) |
691 | |
691 | |
692 | Quite similar to C<aio_readdir>, but the C<$flags> argument allows to tune |
692 | Quite similar to C<aio_readdir>, but the C<$flags> argument allows one to |
693 | behaviour and output format. In case of an error, C<$entries> will be |
693 | tune behaviour and output format. In case of an error, C<$entries> will be |
694 | C<undef>. |
694 | C<undef>. |
695 | |
695 | |
696 | The flags are a combination of the following constants, ORed together (the |
696 | The flags are a combination of the following constants, ORed together (the |
697 | flags will also be passed to the callback, possibly modified): |
697 | flags will also be passed to the callback, possibly modified): |
698 | |
698 | |
… | |
… | |
745 | |
745 | |
746 | =item IO::AIO::READDIR_FOUND_UNKNOWN |
746 | =item IO::AIO::READDIR_FOUND_UNKNOWN |
747 | |
747 | |
748 | This flag should not be set when calling C<aio_readdirx>. Instead, it |
748 | This flag should not be set when calling C<aio_readdirx>. Instead, it |
749 | is being set by C<aio_readdirx>, when any of the C<$type>'s found were |
749 | is being set by C<aio_readdirx>, when any of the C<$type>'s found were |
750 | C<IO::AIO::DT_UNKNOWN>. The absense of this flag therefore indicates that all |
750 | C<IO::AIO::DT_UNKNOWN>. The absence of this flag therefore indicates that all |
751 | C<$type>'s are known, which can be used to speed up some algorithms. |
751 | C<$type>'s are known, which can be used to speed up some algorithms. |
752 | |
752 | |
753 | =back |
753 | =back |
754 | |
754 | |
755 | |
755 | |
… | |
… | |
937 | Then entries will be sorted into likely directories a non-initial dot |
937 | Then entries will be sorted into likely directories a non-initial dot |
938 | currently) and likely non-directories (see C<aio_readdirx>). Then every |
938 | currently) and likely non-directories (see C<aio_readdirx>). Then every |
939 | entry plus an appended C</.> will be C<stat>'ed, likely directories first, |
939 | entry plus an appended C</.> will be C<stat>'ed, likely directories first, |
940 | in order of their inode numbers. If that succeeds, it assumes that the |
940 | in order of their inode numbers. If that succeeds, it assumes that the |
941 | entry is a directory or a symlink to directory (which will be checked |
941 | entry is a directory or a symlink to directory (which will be checked |
942 | seperately). This is often faster than stat'ing the entry itself because |
942 | separately). This is often faster than stat'ing the entry itself because |
943 | filesystems might detect the type of the entry without reading the inode |
943 | filesystems might detect the type of the entry without reading the inode |
944 | data (e.g. ext2fs filetype feature), even on systems that cannot return |
944 | data (e.g. ext2fs filetype feature), even on systems that cannot return |
945 | the filetype information on readdir. |
945 | the filetype information on readdir. |
946 | |
946 | |
947 | If the known number of directories (link count - 2) has been reached, the |
947 | If the known number of directories (link count - 2) has been reached, the |
… | |
… | |
1673 | |
1673 | |
1674 | =item IO::AIO::fadvise $fh, $offset, $len, $advice |
1674 | =item IO::AIO::fadvise $fh, $offset, $len, $advice |
1675 | |
1675 | |
1676 | Simply calls the C<posix_fadvise> function (see its |
1676 | Simply calls the C<posix_fadvise> function (see its |
1677 | manpage for details). The following advice constants are |
1677 | manpage for details). The following advice constants are |
1678 | avaiable: C<IO::AIO::FADV_NORMAL>, C<IO::AIO::FADV_SEQUENTIAL>, |
1678 | available: C<IO::AIO::FADV_NORMAL>, C<IO::AIO::FADV_SEQUENTIAL>, |
1679 | C<IO::AIO::FADV_RANDOM>, C<IO::AIO::FADV_NOREUSE>, |
1679 | C<IO::AIO::FADV_RANDOM>, C<IO::AIO::FADV_NOREUSE>, |
1680 | C<IO::AIO::FADV_WILLNEED>, C<IO::AIO::FADV_DONTNEED>. |
1680 | C<IO::AIO::FADV_WILLNEED>, C<IO::AIO::FADV_DONTNEED>. |
1681 | |
1681 | |
1682 | On systems that do not implement C<posix_fadvise>, this function returns |
1682 | On systems that do not implement C<posix_fadvise>, this function returns |
1683 | ENOSYS, otherwise the return value of C<posix_fadvise>. |
1683 | ENOSYS, otherwise the return value of C<posix_fadvise>. |
1684 | |
1684 | |
1685 | =item IO::AIO::madvise $scalar, $offset, $len, $advice |
1685 | =item IO::AIO::madvise $scalar, $offset, $len, $advice |
1686 | |
1686 | |
1687 | Simply calls the C<posix_madvise> function (see its |
1687 | Simply calls the C<posix_madvise> function (see its |
1688 | manpage for details). The following advice constants are |
1688 | manpage for details). The following advice constants are |
1689 | avaiable: C<IO::AIO::MADV_NORMAL>, C<IO::AIO::MADV_SEQUENTIAL>, |
1689 | available: C<IO::AIO::MADV_NORMAL>, C<IO::AIO::MADV_SEQUENTIAL>, |
1690 | C<IO::AIO::MADV_RANDOM>, C<IO::AIO::MADV_WILLNEED>, C<IO::AIO::MADV_DONTNEED>. |
1690 | C<IO::AIO::MADV_RANDOM>, C<IO::AIO::MADV_WILLNEED>, C<IO::AIO::MADV_DONTNEED>. |
1691 | |
1691 | |
1692 | On systems that do not implement C<posix_madvise>, this function returns |
1692 | On systems that do not implement C<posix_madvise>, this function returns |
1693 | ENOSYS, otherwise the return value of C<posix_madvise>. |
1693 | ENOSYS, otherwise the return value of C<posix_madvise>. |
1694 | |
1694 | |
1695 | =item IO::AIO::mprotect $scalar, $offset, $len, $protect |
1695 | =item IO::AIO::mprotect $scalar, $offset, $len, $protect |
1696 | |
1696 | |
1697 | Simply calls the C<mprotect> function on the preferably AIO::mmap'ed |
1697 | Simply calls the C<mprotect> function on the preferably AIO::mmap'ed |
1698 | $scalar (see its manpage for details). The following protect |
1698 | $scalar (see its manpage for details). The following protect |
1699 | constants are avaiable: C<IO::AIO::PROT_NONE>, C<IO::AIO::PROT_READ>, |
1699 | constants are available: C<IO::AIO::PROT_NONE>, C<IO::AIO::PROT_READ>, |
1700 | C<IO::AIO::PROT_WRITE>, C<IO::AIO::PROT_EXEC>. |
1700 | C<IO::AIO::PROT_WRITE>, C<IO::AIO::PROT_EXEC>. |
1701 | |
1701 | |
1702 | On systems that do not implement C<mprotect>, this function returns |
1702 | On systems that do not implement C<mprotect>, this function returns |
1703 | ENOSYS, otherwise the return value of C<mprotect>. |
1703 | ENOSYS, otherwise the return value of C<mprotect>. |
1704 | |
1704 | |
… | |
… | |
1829 | |
1829 | |
1830 | =over 4 |
1830 | =over 4 |
1831 | |
1831 | |
1832 | =item IO::AIO::reinit |
1832 | =item IO::AIO::reinit |
1833 | |
1833 | |
1834 | Abondons all current requests and I/O threads and simply reinitialises all |
1834 | Abandons all current requests and I/O threads and simply reinitialises all |
1835 | data structures. This is not an operation suppported by any standards, but |
1835 | data structures. This is not an operation supported by any standards, but |
1836 | happens to work on GNU/Linux and some newer BSD systems. |
1836 | happens to work on GNU/Linux and some newer BSD systems. |
1837 | |
1837 | |
1838 | The only reasonable use for this function is to call it after forking, if |
1838 | The only reasonable use for this function is to call it after forking, if |
1839 | C<IO::AIO> was used in the parent. Calling it while IO::AIO is active in |
1839 | C<IO::AIO> was used in the parent. Calling it while IO::AIO is active in |
1840 | the process will result in undefined behaviour. Calling it at any time |
1840 | the process will result in undefined behaviour. Calling it at any time |