ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/README
(Generate patch)

Comparing IO-AIO/README (file contents):
Revision 1.59 by root, Tue Feb 20 06:54:47 2018 UTC vs.
Revision 1.60 by root, Tue Jul 31 22:27:49 2018 UTC

228 228
229 IO::AIO::sendfile $ofh, $ifh, $offset, $count 229 IO::AIO::sendfile $ofh, $ifh, $offset, $count
230 IO::AIO::fadvise $fh, $offset, $len, $advice 230 IO::AIO::fadvise $fh, $offset, $len, $advice
231 IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]] 231 IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]]
232 IO::AIO::munmap $scalar 232 IO::AIO::munmap $scalar
233 IO::AIO::mremap $scalar, $new_length, $flags[, $new_address]
233 IO::AIO::madvise $scalar, $offset, $length, $advice 234 IO::AIO::madvise $scalar, $offset, $length, $advice
234 IO::AIO::mprotect $scalar, $offset, $length, $protect 235 IO::AIO::mprotect $scalar, $offset, $length, $protect
235 IO::AIO::munlock $scalar, $offset = 0, $length = undef 236 IO::AIO::munlock $scalar, $offset = 0, $length = undef
236 IO::AIO::munlockall 237 IO::AIO::munlockall
237 238
339 "O_APPEND"), the following POSIX and non-POSIX constants are 340 "O_APPEND"), the following POSIX and non-POSIX constants are
340 available (missing ones on your system are, as usual, 0): 341 available (missing ones on your system are, as usual, 0):
341 342
342 "O_ASYNC", "O_DIRECT", "O_NOATIME", "O_CLOEXEC", "O_NOCTTY", 343 "O_ASYNC", "O_DIRECT", "O_NOATIME", "O_CLOEXEC", "O_NOCTTY",
343 "O_NOFOLLOW", "O_NONBLOCK", "O_EXEC", "O_SEARCH", "O_DIRECTORY", 344 "O_NOFOLLOW", "O_NONBLOCK", "O_EXEC", "O_SEARCH", "O_DIRECTORY",
344 "O_DSYNC", "O_RSYNC", "O_SYNC", "O_PATH", "O_TMPFILE", and 345 "O_DSYNC", "O_RSYNC", "O_SYNC", "O_PATH", "O_TMPFILE", "O_TTY_INIT"
345 "O_TTY_INIT". 346 and "O_ACCMODE".
346 347
347 aio_close $fh, $callback->($status) 348 aio_close $fh, $callback->($status)
348 Asynchronously close a file and call the callback with the result 349 Asynchronously close a file and call the callback with the result
349 code. 350 code.
350 351
686 The flags are a combination of the following constants, ORed 687 The flags are a combination of the following constants, ORed
687 together (the flags will also be passed to the callback, possibly 688 together (the flags will also be passed to the callback, possibly
688 modified): 689 modified):
689 690
690 IO::AIO::READDIR_DENTS 691 IO::AIO::READDIR_DENTS
691 When this flag is off, then the callback gets an arrayref 692 Normally the callback gets an arrayref consisting of names only
692 consisting of names only (as with "aio_readdir"), otherwise it 693 (as with "aio_readdir"). If this flag is set, then the callback
693 gets an arrayref with "[$name, $type, $inode]" arrayrefs, each 694 gets an arrayref with "[$name, $type, $inode]" arrayrefs, each
694 describing a single directory entry in more detail. 695 describing a single directory entry in more detail:
695 696
696 $name is the name of the entry. 697 $name is the name of the entry.
697 698
698 $type is one of the "IO::AIO::DT_xxx" constants: 699 $type is one of the "IO::AIO::DT_xxx" constants:
699 700
700 "IO::AIO::DT_UNKNOWN", "IO::AIO::DT_FIFO", "IO::AIO::DT_CHR", 701 "IO::AIO::DT_UNKNOWN", "IO::AIO::DT_FIFO", "IO::AIO::DT_CHR",
701 "IO::AIO::DT_DIR", "IO::AIO::DT_BLK", "IO::AIO::DT_REG", 702 "IO::AIO::DT_DIR", "IO::AIO::DT_BLK", "IO::AIO::DT_REG",
702 "IO::AIO::DT_LNK", "IO::AIO::DT_SOCK", "IO::AIO::DT_WHT". 703 "IO::AIO::DT_LNK", "IO::AIO::DT_SOCK", "IO::AIO::DT_WHT".
703 704
704 "IO::AIO::DT_UNKNOWN" means just that: readdir does not know. If 705 "IO::AIO::DT_UNKNOWN" means just that: readdir does not know. If
705 you need to know, you have to run stat yourself. Also, for speed 706 you need to know, you have to run stat yourself. Also, for
706 reasons, the $type scalars are read-only: you can not modify 707 speed/memory reasons, the $type scalars are read-only: you must
707 them. 708 not modify them.
708 709
709 $inode is the inode number (which might not be exact on systems 710 $inode is the inode number (which might not be exact on systems
710 with 64 bit inode numbers and 32 bit perls). This field has 711 with 64 bit inode numbers and 32 bit perls). This field has
711 unspecified content on systems that do not deliver the inode 712 unspecified content on systems that do not deliver the inode
712 information. 713 information.
724 of which names with short names are tried first. 725 of which names with short names are tried first.
725 726
726 IO::AIO::READDIR_STAT_ORDER 727 IO::AIO::READDIR_STAT_ORDER
727 When this flag is set, then the names will be returned in an 728 When this flag is set, then the names will be returned in an
728 order suitable for stat()'ing each one. That is, when you plan 729 order suitable for stat()'ing each one. That is, when you plan
729 to stat() all files in the given directory, then the returned 730 to stat() most or all files in the given directory, then the
730 order will likely be fastest. 731 returned order will likely be faster.
731 732
732 If both this flag and "IO::AIO::READDIR_DIRS_FIRST" are 733 If both this flag and "IO::AIO::READDIR_DIRS_FIRST" are
733 specified, then the likely dirs come first, resulting in a less 734 specified, then the likely dirs come first, resulting in a less
734 optimal stat order. 735 optimal stat order for stat'ing all entries, but likely a more
736 optimal order for finding subdirectories.
735 737
736 IO::AIO::READDIR_FOUND_UNKNOWN 738 IO::AIO::READDIR_FOUND_UNKNOWN
737 This flag should not be set when calling "aio_readdirx". 739 This flag should not be set when calling "aio_readdirx".
738 Instead, it is being set by "aio_readdirx", when any of the 740 Instead, it is being set by "aio_readdirx", when any of the
739 $type's found were "IO::AIO::DT_UNKNOWN". The absence of this 741 $type's found were "IO::AIO::DT_UNKNOWN". The absence of this
1724 my $fast_md5 = md5 $data; 1726 my $fast_md5 = md5 $data;
1725 1727
1726 IO::AIO::munmap $scalar 1728 IO::AIO::munmap $scalar
1727 Removes a previous mmap and undefines the $scalar. 1729 Removes a previous mmap and undefines the $scalar.
1728 1730
1731 IO::AIO::mremap $scalar, $new_length, $flags = MREMAP_MAYMOVE[,
1732 $new_address = 0]
1733 Calls the Linux-specific mremap(2) system call. The $scalar must
1734 have been mapped by "IO::AIO::mmap", and $flags must currently
1735 either be 0 or "IO::AIO::MREMAP_MAYMOVE".
1736
1737 Returns true if successful, and false otherwise. If the underlying
1738 mmapped region has changed address, then the true value has the
1739 numerical value 1, otherwise it has the numerical value 0:
1740
1741 my $success = IO::AIO::mremap $mmapped, 8192, IO::AIO::MREMAP_MAYMOVE
1742 or die "mremap: $!";
1743
1744 if ($success*1) {
1745 warn "scalar has chanegd address in memory\n";
1746 }
1747
1748 "IO::AIO::MREMAP_FIXED" and the $new_address argument are currently
1749 implemented, but not supported and might go away in a future
1750 version.
1751
1752 On systems where this call is not supported or is not emulated, this
1753 call returns falls and sets $! to "ENOSYS".
1754
1729 IO::AIO::munlock $scalar, $offset = 0, $length = undef 1755 IO::AIO::munlock $scalar, $offset = 0, $length = undef
1730 Calls the "munlock" function, undoing the effects of a previous 1756 Calls the "munlock" function, undoing the effects of a previous
1731 "aio_mlock" call (see its description for details). 1757 "aio_mlock" call (see its description for details).
1732 1758
1733 IO::AIO::munlockall 1759 IO::AIO::munlockall

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines