… | |
… | |
1016 | IO::AIO::mmap $data, -s $fh, IO::AIO::PROT_READ, IO::AIO::MAP_SHARED, $fh; |
1016 | IO::AIO::mmap $data, -s $fh, IO::AIO::PROT_READ, IO::AIO::MAP_SHARED, $fh; |
1017 | aio_mlock $data; # mlock in background |
1017 | aio_mlock $data; # mlock in background |
1018 | |
1018 | |
1019 | aio_mlockall $flags, $callback->($status) |
1019 | aio_mlockall $flags, $callback->($status) |
1020 | Calls the "mlockall" function with the given $flags (a combination |
1020 | Calls the "mlockall" function with the given $flags (a combination |
1021 | of "IO::AIO::MCL_CURRENT" and "IO::AIO::MCL_FUTURE"). |
1021 | of "IO::AIO::MCL_CURRENT", "IO::AIO::MCL_FUTURE" and |
|
|
1022 | "IO::AIO::MCL_ONFAULT"). |
1022 | |
1023 | |
1023 | On systems that do not implement "mlockall", this function returns |
1024 | On systems that do not implement "mlockall", this function returns |
1024 | -1 and sets errno to "ENOSYS". |
1025 | -1 and sets errno to "ENOSYS". Similarly, flag combinations not |
|
|
1026 | supported by the system result in a return value of -1 with errno |
|
|
1027 | being set to "EINVAL". |
1025 | |
1028 | |
1026 | Note that the corresponding "munlockall" is synchronous and is |
1029 | Note that the corresponding "munlockall" is synchronous and is |
1027 | documented under "MISCELLANEOUS FUNCTIONS". |
1030 | documented under "MISCELLANEOUS FUNCTIONS". |
1028 | |
1031 | |
1029 | Example: asynchronously lock all current and future pages into |
1032 | Example: asynchronously lock all current and future pages into |
… | |
… | |
1664 | ($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtimensec |
1667 | ($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtimensec |
1665 | Like the functions above, but returns all four times in one go (and |
1668 | Like the functions above, but returns all four times in one go (and |
1666 | maybe more in future versions). |
1669 | maybe more in future versions). |
1667 | |
1670 | |
1668 | $counter = IO::AIO::st_gen |
1671 | $counter = IO::AIO::st_gen |
1669 | Returns the generation counter of the file. This is only available |
1672 | Returns the generation counter (in practice this is just a random |
1670 | on platforms which have this member in their "struct stat" (most |
1673 | number) of the file. This is only available on platforms which have |
1671 | BSDs at the time of this writing) and generally only to the root |
1674 | this member in their "struct stat" (most BSDs at the time of this |
1672 | usert. If unsupported, 0 is returned, but this might change to |
1675 | writing) and generally only to the root usert. If unsupported, 0 is |
1673 | "undef" in a future version. |
1676 | returned, but this might change to "undef" in a future version. |
1674 | |
1677 | |
1675 | Example: print the high resolution modification time of /etc, using |
1678 | Example: print the high resolution modification time of /etc, using |
1676 | "stat", and "IO::AIO::aio_stat". |
1679 | "stat", and "IO::AIO::aio_stat". |
1677 | |
1680 | |
1678 | if (stat "/etc") { |
1681 | if (stat "/etc") { |
… | |
… | |
1851 | version. |
1854 | version. |
1852 | |
1855 | |
1853 | On systems where this call is not supported or is not emulated, this |
1856 | On systems where this call is not supported or is not emulated, this |
1854 | call returns falls and sets $! to "ENOSYS". |
1857 | call returns falls and sets $! to "ENOSYS". |
1855 | |
1858 | |
|
|
1859 | IO::AIO::mlockall $flags |
|
|
1860 | Calls the "eio_mlockall_sync" function, which is like |
|
|
1861 | "aio_mlockall", but is blocking. |
|
|
1862 | |
1856 | IO::AIO::munlock $scalar, $offset = 0, $length = undef |
1863 | IO::AIO::munlock $scalar, $offset = 0, $length = undef |
1857 | Calls the "munlock" function, undoing the effects of a previous |
1864 | Calls the "munlock" function, undoing the effects of a previous |
1858 | "aio_mlock" call (see its description for details). |
1865 | "aio_mlock" call (see its description for details). |
1859 | |
1866 | |
1860 | IO::AIO::munlockall |
1867 | IO::AIO::munlockall |