… | |
… | |
179 | aio_pathsync aio_readahead |
179 | aio_pathsync aio_readahead |
180 | aio_rename aio_link aio_move aio_copy aio_group |
180 | aio_rename aio_link aio_move aio_copy aio_group |
181 | aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown |
181 | aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown |
182 | aio_chmod aio_utime aio_truncate |
182 | aio_chmod aio_utime aio_truncate |
183 | aio_msync aio_mtouch aio_mlock aio_mlockall |
183 | aio_msync aio_mtouch aio_mlock aio_mlockall |
184 | aio_statvfs); |
184 | aio_statvfs |
|
|
185 | aio_wd); |
185 | |
186 | |
186 | our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice)); |
187 | our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice)); |
187 | our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush |
188 | our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush |
188 | min_parallel max_parallel max_idle idle_timeout |
189 | min_parallel max_parallel max_idle idle_timeout |
189 | nreqs nready npending nthreads |
190 | nreqs nready npending nthreads |
… | |
… | |
205 | |
206 | |
206 | This section simply lists the prototypes of the most important functions |
207 | This section simply lists the prototypes of the most important functions |
207 | for quick reference. See the following sections for function-by-function |
208 | for quick reference. See the following sections for function-by-function |
208 | documentation. |
209 | documentation. |
209 | |
210 | |
|
|
211 | aio_wd $pathname, $callback->($wd) |
210 | aio_open $pathname, $flags, $mode, $callback->($fh) |
212 | aio_open $pathname, $flags, $mode, $callback->($fh) |
211 | aio_close $fh, $callback->($status) |
213 | aio_close $fh, $callback->($status) |
212 | aio_read $fh,$offset,$length, $data,$dataoffset, $callback->($retval) |
214 | aio_read $fh,$offset,$length, $data,$dataoffset, $callback->($retval) |
213 | aio_write $fh,$offset,$length, $data,$dataoffset, $callback->($retval) |
215 | aio_write $fh,$offset,$length, $data,$dataoffset, $callback->($retval) |
214 | aio_sendfile $out_fh, $in_fh, $in_offset, $length, $callback->($retval) |
216 | aio_sendfile $out_fh, $in_fh, $in_offset, $length, $callback->($retval) |
… | |
… | |
687 | array-ref with the filenames. |
689 | array-ref with the filenames. |
688 | |
690 | |
689 | |
691 | |
690 | =item aio_readdirx $pathname, $flags, $callback->($entries, $flags) |
692 | =item aio_readdirx $pathname, $flags, $callback->($entries, $flags) |
691 | |
693 | |
692 | Quite similar to C<aio_readdir>, but the C<$flags> argument allows to tune |
694 | 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 |
695 | tune behaviour and output format. In case of an error, C<$entries> will be |
694 | C<undef>. |
696 | C<undef>. |
695 | |
697 | |
696 | The flags are a combination of the following constants, ORed together (the |
698 | The flags are a combination of the following constants, ORed together (the |
697 | flags will also be passed to the callback, possibly modified): |
699 | flags will also be passed to the callback, possibly modified): |
698 | |
700 | |
… | |
… | |
745 | |
747 | |
746 | =item IO::AIO::READDIR_FOUND_UNKNOWN |
748 | =item IO::AIO::READDIR_FOUND_UNKNOWN |
747 | |
749 | |
748 | This flag should not be set when calling C<aio_readdirx>. Instead, it |
750 | 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 |
751 | 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 |
752 | 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. |
753 | C<$type>'s are known, which can be used to speed up some algorithms. |
752 | |
754 | |
753 | =back |
755 | =back |
754 | |
756 | |
755 | |
757 | |
… | |
… | |
937 | Then entries will be sorted into likely directories a non-initial dot |
939 | Then entries will be sorted into likely directories a non-initial dot |
938 | currently) and likely non-directories (see C<aio_readdirx>). Then every |
940 | 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, |
941 | 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 |
942 | 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 |
943 | 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 |
944 | 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 |
945 | 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 |
946 | data (e.g. ext2fs filetype feature), even on systems that cannot return |
945 | the filetype information on readdir. |
947 | the filetype information on readdir. |
946 | |
948 | |
947 | If the known number of directories (link count - 2) has been reached, the |
949 | If the known number of directories (link count - 2) has been reached, the |
… | |
… | |
1673 | |
1675 | |
1674 | =item IO::AIO::fadvise $fh, $offset, $len, $advice |
1676 | =item IO::AIO::fadvise $fh, $offset, $len, $advice |
1675 | |
1677 | |
1676 | Simply calls the C<posix_fadvise> function (see its |
1678 | Simply calls the C<posix_fadvise> function (see its |
1677 | manpage for details). The following advice constants are |
1679 | manpage for details). The following advice constants are |
1678 | avaiable: C<IO::AIO::FADV_NORMAL>, C<IO::AIO::FADV_SEQUENTIAL>, |
1680 | available: C<IO::AIO::FADV_NORMAL>, C<IO::AIO::FADV_SEQUENTIAL>, |
1679 | C<IO::AIO::FADV_RANDOM>, C<IO::AIO::FADV_NOREUSE>, |
1681 | C<IO::AIO::FADV_RANDOM>, C<IO::AIO::FADV_NOREUSE>, |
1680 | C<IO::AIO::FADV_WILLNEED>, C<IO::AIO::FADV_DONTNEED>. |
1682 | C<IO::AIO::FADV_WILLNEED>, C<IO::AIO::FADV_DONTNEED>. |
1681 | |
1683 | |
1682 | On systems that do not implement C<posix_fadvise>, this function returns |
1684 | On systems that do not implement C<posix_fadvise>, this function returns |
1683 | ENOSYS, otherwise the return value of C<posix_fadvise>. |
1685 | ENOSYS, otherwise the return value of C<posix_fadvise>. |
1684 | |
1686 | |
1685 | =item IO::AIO::madvise $scalar, $offset, $len, $advice |
1687 | =item IO::AIO::madvise $scalar, $offset, $len, $advice |
1686 | |
1688 | |
1687 | Simply calls the C<posix_madvise> function (see its |
1689 | Simply calls the C<posix_madvise> function (see its |
1688 | manpage for details). The following advice constants are |
1690 | manpage for details). The following advice constants are |
1689 | avaiable: C<IO::AIO::MADV_NORMAL>, C<IO::AIO::MADV_SEQUENTIAL>, |
1691 | 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>. |
1692 | C<IO::AIO::MADV_RANDOM>, C<IO::AIO::MADV_WILLNEED>, C<IO::AIO::MADV_DONTNEED>. |
1691 | |
1693 | |
1692 | On systems that do not implement C<posix_madvise>, this function returns |
1694 | On systems that do not implement C<posix_madvise>, this function returns |
1693 | ENOSYS, otherwise the return value of C<posix_madvise>. |
1695 | ENOSYS, otherwise the return value of C<posix_madvise>. |
1694 | |
1696 | |
1695 | =item IO::AIO::mprotect $scalar, $offset, $len, $protect |
1697 | =item IO::AIO::mprotect $scalar, $offset, $len, $protect |
1696 | |
1698 | |
1697 | Simply calls the C<mprotect> function on the preferably AIO::mmap'ed |
1699 | Simply calls the C<mprotect> function on the preferably AIO::mmap'ed |
1698 | $scalar (see its manpage for details). The following protect |
1700 | $scalar (see its manpage for details). The following protect |
1699 | constants are avaiable: C<IO::AIO::PROT_NONE>, C<IO::AIO::PROT_READ>, |
1701 | constants are available: C<IO::AIO::PROT_NONE>, C<IO::AIO::PROT_READ>, |
1700 | C<IO::AIO::PROT_WRITE>, C<IO::AIO::PROT_EXEC>. |
1702 | C<IO::AIO::PROT_WRITE>, C<IO::AIO::PROT_EXEC>. |
1701 | |
1703 | |
1702 | On systems that do not implement C<mprotect>, this function returns |
1704 | On systems that do not implement C<mprotect>, this function returns |
1703 | ENOSYS, otherwise the return value of C<mprotect>. |
1705 | ENOSYS, otherwise the return value of C<mprotect>. |
1704 | |
1706 | |
… | |
… | |
1829 | |
1831 | |
1830 | =over 4 |
1832 | =over 4 |
1831 | |
1833 | |
1832 | =item IO::AIO::reinit |
1834 | =item IO::AIO::reinit |
1833 | |
1835 | |
1834 | Abondons all current requests and I/O threads and simply reinitialises all |
1836 | 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 |
1837 | data structures. This is not an operation supported by any standards, but |
1836 | happens to work on GNU/Linux and some newer BSD systems. |
1838 | happens to work on GNU/Linux and some newer BSD systems. |
1837 | |
1839 | |
1838 | The only reasonable use for this function is to call it after forking, if |
1840 | 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 |
1841 | 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 |
1842 | the process will result in undefined behaviour. Calling it at any time |