… | |
… | |
265 | |
265 | |
266 | $fh = IO::AIO::pidfd_open $pid[, $flags] |
266 | $fh = IO::AIO::pidfd_open $pid[, $flags] |
267 | $status = IO::AIO::pidfd_send_signal $pidfh, $signal[, $siginfo[, $flags]] |
267 | $status = IO::AIO::pidfd_send_signal $pidfh, $signal[, $siginfo[, $flags]] |
268 | $fh = IO::AIO::pidfd_getfd $pidfh, $targetfd[, $flags] |
268 | $fh = IO::AIO::pidfd_getfd $pidfh, $targetfd[, $flags] |
269 | |
269 | |
|
|
270 | $retval = IO::AIO::mount $special, $path, $fstype, $flags = 0, $data = undef |
|
|
271 | $retval = IO::AIO::umount $path, $flags = 0 |
|
|
272 | |
270 | API NOTES |
273 | API NOTES |
271 | All the "aio_*" calls are more or less thin wrappers around the syscall |
274 | All the "aio_*" calls are more or less thin wrappers around the syscall |
272 | with the same name (sans "aio_"). The arguments are similar or |
275 | with the same name (sans "aio_"). The arguments are similar or |
273 | identical, and they all accept an additional (and optional) $callback |
276 | identical, and they all accept an additional (and optional) $callback |
274 | argument which must be a code reference. This code reference will be |
277 | argument which must be a code reference. This code reference will be |
… | |
… | |
340 | aio_open $pathname, $flags, $mode, $callback->($fh) |
343 | aio_open $pathname, $flags, $mode, $callback->($fh) |
341 | Asynchronously open or create a file and call the callback with a |
344 | Asynchronously open or create a file and call the callback with a |
342 | newly created filehandle for the file (or "undef" in case of an |
345 | newly created filehandle for the file (or "undef" in case of an |
343 | error). |
346 | error). |
344 | |
347 | |
345 | The pathname passed to "aio_open" must be absolute. See API NOTES, |
|
|
346 | above, for an explanation. |
|
|
347 | |
|
|
348 | The $flags argument is a bitmask. See the "Fcntl" module for a list. |
348 | The $flags argument is a bitmask. See the "Fcntl" module for a list. |
349 | They are the same as used by "sysopen". |
349 | They are the same as used by "sysopen". |
350 | |
350 | |
351 | Likewise, $mode specifies the mode of the newly created file, if it |
351 | Likewise, $mode specifies the mode of the newly created file, if it |
352 | didn't exist and "O_CREAT" has been given, just like perl's |
352 | didn't exist and "O_CREAT" has been given, just like perl's |
… | |
… | |
504 | aio_lstat $fh, $callback->($status) |
504 | aio_lstat $fh, $callback->($status) |
505 | Works almost exactly like perl's "stat" or "lstat" in void context. |
505 | Works almost exactly like perl's "stat" or "lstat" in void context. |
506 | The callback will be called after the stat and the results will be |
506 | The callback will be called after the stat and the results will be |
507 | available using "stat _" or "-s _" and other tests (with the |
507 | available using "stat _" or "-s _" and other tests (with the |
508 | exception of "-B" and "-T"). |
508 | exception of "-B" and "-T"). |
509 | |
|
|
510 | The pathname passed to "aio_stat" must be absolute. See API NOTES, |
|
|
511 | above, for an explanation. |
|
|
512 | |
509 | |
513 | Currently, the stats are always 64-bit-stats, i.e. instead of |
510 | Currently, the stats are always 64-bit-stats, i.e. instead of |
514 | returning an error when stat'ing a large file, the results will be |
511 | returning an error when stat'ing a large file, the results will be |
515 | silently truncated unless perl itself is compiled with large file |
512 | silently truncated unless perl itself is compiled with large file |
516 | support. |
513 | support. |
… | |
… | |
860 | print "everything else: @$nondirs\n"; |
857 | print "everything else: @$nondirs\n"; |
861 | }; |
858 | }; |
862 | |
859 | |
863 | Implementation notes. |
860 | Implementation notes. |
864 | |
861 | |
865 | The "aio_readdir" cannot be avoided, but "stat()"'ing every entry |
862 | The "aio_readdir" cannot be avoided, but stat()'ing every entry can. |
866 | can. |
|
|
867 | |
863 | |
868 | If readdir returns file type information, then this is used directly |
864 | If readdir returns file type information, then this is used directly |
869 | to find directories. |
865 | to find directories. |
870 | |
866 | |
871 | Otherwise, after reading the directory, the modification time, size |
867 | Otherwise, after reading the directory, the modification time, size |
… | |
… | |
951 | "FS_XFLAG_NODUMP", "FS_XFLAG_RTINHERIT", "FS_XFLAG_PROJINHERIT", |
947 | "FS_XFLAG_NODUMP", "FS_XFLAG_RTINHERIT", "FS_XFLAG_PROJINHERIT", |
952 | "FS_XFLAG_NOSYMLINKS", "FS_XFLAG_EXTSIZE", "FS_XFLAG_EXTSZINHERIT", |
948 | "FS_XFLAG_NOSYMLINKS", "FS_XFLAG_EXTSIZE", "FS_XFLAG_EXTSZINHERIT", |
953 | "FS_XFLAG_NODEFRAG", "FS_XFLAG_FILESTREAM", "FS_XFLAG_DAX", |
949 | "FS_XFLAG_NODEFRAG", "FS_XFLAG_FILESTREAM", "FS_XFLAG_DAX", |
954 | "FS_XFLAG_HASATTR", |
950 | "FS_XFLAG_HASATTR", |
955 | |
951 | |
|
|
952 | "BLKROSET", "BLKROGET", "BLKRRPART", "BLKGETSIZE", "BLKFLSBUF", |
|
|
953 | "BLKRASET", "BLKRAGET", "BLKFRASET", "BLKFRAGET", "BLKSECTSET", |
|
|
954 | "BLKSECTGET", "BLKSSZGET", "BLKBSZGET", "BLKBSZSET", "BLKGETSIZE64", |
|
|
955 | |
956 | aio_sync $callback->($status) |
956 | aio_sync $callback->($status) |
957 | Asynchronously call sync and call the callback when finished. |
957 | Asynchronously call sync and call the callback when finished. |
958 | |
958 | |
959 | aio_fsync $fh, $callback->($status) |
959 | aio_fsync $fh, $callback->($status) |
960 | Asynchronously call fsync on the given filehandle and call the |
960 | Asynchronously call fsync on the given filehandle and call the |
… | |
… | |
1742 | $retval = IO::AIO::fexecve $fh, $argv, $envp |
1742 | $retval = IO::AIO::fexecve $fh, $argv, $envp |
1743 | A more-or-less direct equivalent to the POSIX "fexecve" functions, |
1743 | A more-or-less direct equivalent to the POSIX "fexecve" functions, |
1744 | which allows you to specify the program to be executed via a file |
1744 | which allows you to specify the program to be executed via a file |
1745 | descriptor (or handle). Returns -1 and sets errno to "ENOSYS" if not |
1745 | descriptor (or handle). Returns -1 and sets errno to "ENOSYS" if not |
1746 | available. |
1746 | available. |
|
|
1747 | |
|
|
1748 | $retval = IO::AIO::mount $special, $path, $fstype, $flags = 0, $data = |
|
|
1749 | undef |
|
|
1750 | Calls the GNU/Linux mount syscall with the given arguments. All |
|
|
1751 | except $flags are strings, and if $data is "undef", a "NULL" will be |
|
|
1752 | passed. |
|
|
1753 | |
|
|
1754 | The following values for $flags are available: |
|
|
1755 | |
|
|
1756 | "IO::AIO::MS_RDONLY", "IO::AIO::MS_NOSUID", "IO::AIO::MS_NODEV", |
|
|
1757 | "IO::AIO::MS_NOEXEC", "IO::AIO::MS_SYNCHRONOUS", |
|
|
1758 | "IO::AIO::MS_REMOUNT", "IO::AIO::MS_MANDLOCK", |
|
|
1759 | "IO::AIO::MS_DIRSYNC", "IO::AIO::MS_NOATIME", |
|
|
1760 | "IO::AIO::MS_NODIRATIME", "IO::AIO::MS_BIND", "IO::AIO::MS_MOVE", |
|
|
1761 | "IO::AIO::MS_REC", "IO::AIO::MS_SILENT", "IO::AIO::MS_POSIXACL", |
|
|
1762 | "IO::AIO::MS_UNBINDABLE", "IO::AIO::MS_PRIVATE", |
|
|
1763 | "IO::AIO::MS_SLAVE", "IO::AIO::MS_SHARED", "IO::AIO::MS_RELATIME", |
|
|
1764 | "IO::AIO::MS_KERNMOUNT", "IO::AIO::MS_I_VERSION", |
|
|
1765 | "IO::AIO::MS_STRICTATIME", "IO::AIO::MS_LAZYTIME", |
|
|
1766 | "IO::AIO::MS_ACTIVE", "IO::AIO::MS_NOUSER", "IO::AIO::MS_RMT_MASK", |
|
|
1767 | "IO::AIO::MS_MGC_VAL" and "IO::AIO::MS_MGC_MSK". |
|
|
1768 | |
|
|
1769 | $retval = IO::AIO::umount $path, $flags = 0 |
|
|
1770 | Invokes the GNU/Linux "umount" or "umount2" syscalls. Always calls |
|
|
1771 | "umount" if $flags is 0, otherwqise always tries to call "umount2". |
|
|
1772 | |
|
|
1773 | The following $flags are available: |
|
|
1774 | |
|
|
1775 | "IO::AIO::MNT_FORCE", "IO::AIO::MNT_DETACH", "IO::AIO::MNT_EXPIRE" |
|
|
1776 | and "IO::AIO::UMOUNT_NOFOLLOW". |
1747 | |
1777 | |
1748 | $numfd = IO::AIO::get_fdlimit |
1778 | $numfd = IO::AIO::get_fdlimit |
1749 | Tries to find the current file descriptor limit and returns it, or |
1779 | Tries to find the current file descriptor limit and returns it, or |
1750 | "undef" and sets $! in case of an error. The limit is one larger |
1780 | "undef" and sets $! in case of an error. The limit is one larger |
1751 | than the highest valid file descriptor number. |
1781 | than the highest valid file descriptor number. |