--- IO-AIO/AIO.pm 2022/09/05 00:03:32 1.315 +++ IO-AIO/AIO.pm 2023/09/27 03:09:57 1.319 @@ -173,7 +173,7 @@ use base 'Exporter'; BEGIN { - our $VERSION = 4.77; + our $VERSION = 4.80; our @AIO_REQ = qw(aio_sendfile aio_seek aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx @@ -197,7 +197,7 @@ mmap munmap mremap munlock munlockall accept4 tee splice pipe2 pipesize - fexecve memfd_create eventfd + fexecve mount umount memfd_create eventfd timerfd_create timerfd_settime timerfd_gettime pidfd_open pidfd_send_signal pidfd_getfd); @@ -329,6 +329,9 @@ $status = IO::AIO::pidfd_send_signal $pidfh, $signal[, $siginfo[, $flags]] $fh = IO::AIO::pidfd_getfd $pidfh, $targetfd[, $flags] + $retval = IO::AIO::mount $special, $path, $fstype, $flags = 0, $data = undef + $retval = IO::AIO::umount $path, $flags = 0 + =head2 API NOTES All the C calls are more or less thin wrappers around the syscall @@ -412,9 +415,6 @@ Asynchronously open or create a file and call the callback with a newly created filehandle for the file (or C in case of an error). -The pathname passed to C must be absolute. See API NOTES, above, -for an explanation. - The C<$flags> argument is a bitmask. See the C module for a list. They are the same as used by C. @@ -584,9 +584,6 @@ using C or C<-s _> and other tests (with the exception of C<-B> and C<-T>). -The pathname passed to C must be absolute. See API NOTES, above, -for an explanation. - Currently, the stats are always 64-bit-stats, i.e. instead of returning an error when stat'ing a large file, the results will be silently truncated unless perl itself is compiled with large file support. @@ -980,6 +977,11 @@ aioreq_pri $pri; add $grp aio_open $dst, O_CREAT | O_WRONLY | O_TRUNC, 0200, sub { if (my $dst_fh = $_[0]) { + + # best-effort preallocate + aioreq_pri $pri; + add $grp aio_allocate $dst_fh, IO::AIO::FALLOC_FL_KEEP_SIZE, 0, $stat[7], sub { }; + aioreq_pri $pri; add $grp aio_sendfile $dst_fh, $src_fh, 0, $stat[7], sub { if ($_[0] == $stat[7]) { @@ -1353,6 +1355,11 @@ C, C, C, C, C, C, C, C, +C, C, C, C, C, C, +C, C, C, C, C, C, +C, C, C, + + =item aio_sync $callback->($status) Asynchronously call sync and call the callback when finished. @@ -2241,6 +2248,32 @@ allows you to specify the program to be executed via a file descriptor (or handle). Returns C<-1> and sets errno to C if not available. +=item $retval = IO::AIO::mount $special, $path, $fstype, $flags = 0, $data = undef + +Calls the GNU/Linux mount syscall with the given arguments. All except +C<$flags> are strings, and if C<$data> is C, a C will be +passed. + +The following values for C<$flags> are available: + +C, C, C, C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, C and +C. + +=item $retval = IO::AIO::umount $path, $flags = 0 + +Invokes the GNU/Linux C or C syscalls. Always calls +C if C<$flags> is C<0>, otherwqise always tries to call +C. + +The following C<$flags> are available: + +C, C, C and C. + =item $numfd = IO::AIO::get_fdlimit Tries to find the current file descriptor limit and returns it, or