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.206 by root, Sun Jul 24 03:32:51 2011 UTC vs.
Revision 1.207 by root, Mon Jul 25 16:50:33 2011 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines