--- IO-AIO/AIO.pm 2009/11/30 22:22:13 1.168 +++ IO-AIO/AIO.pm 2010/01/02 14:24:32 1.171 @@ -193,7 +193,7 @@ use base 'Exporter'; BEGIN { - our $VERSION = '3.31'; + our $VERSION = '3.4'; our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx @@ -201,7 +201,8 @@ aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead aio_rename aio_link aio_move aio_copy aio_group aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown - aio_chmod aio_utime aio_truncate); + aio_chmod aio_utime aio_truncate + aio_msync aio_mtouch); our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice)); our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush @@ -382,9 +383,10 @@ zero-copy operation. For this to work, C<$out_fh> should refer to a socket, and C<$in_fh> should refer to mmap'able file. -If the native sendfile call fails or is not implemented, it will be -emulated, so you can call C on any type of filehandle -regardless of the limitations of the operating system. +If a native sendfile cannot be found or it fails with C, +C, C, C, C or C, +it will be emulated, so you can call C on any type of +filehandle regardless of the limitations of the operating system. Please note, however, that C can read more bytes from C<$in_fh> than are written, and there is no way to find out how many @@ -991,6 +993,32 @@ $grp } +=item aio_msync $scalar, $offset = 0, $length = undef, flags = 0, $callback->($status) + +This is a rather advanced IO::AIO call, which only works on mmap(2)ed +scalars (see the L or L modules for details on this, note +that the scalar must only be modified in-place while an aio operation is +pending on it). + +It calls the C function of your OS, if available, with the memory +area starting at C<$offset> in the string and ending C<$length> bytes +later. If C<$length> is negative, counts from the end, and if C<$length> +is C, then it goes till the end of the string. The flags can be +a combination of C, C and +C. + +=item aio_mtouch $scalar, $offset = 0, $length = undef, flags = 0, $callback->($status) + +This is a rather advanced IO::AIO call, which works best on mmap(2)ed +scalars. + +It touches (reads or writes) all memory pages in the specified +range inside the scalar. All caveats and parameters are the same +as for C, above, except for flags, which must be either +C<0> (which reads all pages and ensures they are instantiated) or +C, which modifies the memory page s(by reading and +writing an octet from it, which dirties the page). + =item aio_group $callback->(...) This is a very special aio request: Instead of doing something, it is a