--- IO-AIO/AIO.pm 2016/08/09 11:39:17 1.267 +++ IO-AIO/AIO.pm 2017/05/30 22:45:52 1.268 @@ -173,7 +173,7 @@ use base 'Exporter'; BEGIN { - our $VERSION = 4.34; + our $VERSION = 4.35; 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 @@ -254,7 +254,7 @@ aio_fdatasync $fh, $callback->($status) aio_sync_file_range $fh, $offset, $nbytes, $flags, $callback->($status) aio_pathsync $pathname, $callback->($status) - aio_msync $scalar, $offset = 0, $length = undef, flags = 0, $callback->($status) + aio_msync $scalar, $offset = 0, $length = undef, flags = MS_SYNC, $callback->($status) aio_mtouch $scalar, $offset = 0, $length = undef, flags = 0, $callback->($status) aio_mlock $scalar, $offset = 0, $length = undef, $callback->($status) aio_mlockall $flags, $callback->($status) @@ -1352,7 +1352,7 @@ $grp } -=item aio_msync $scalar, $offset = 0, $length = undef, flags = 0, $callback->($status) +=item aio_msync $scalar, $offset = 0, $length = undef, flags = MS_SYNC, $callback->($status) This is a rather advanced IO::AIO call, which only works on mmap(2)ed scalars (see the C function, although it also works on data @@ -1364,8 +1364,8 @@ 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. +either C or C, plus an optional +C. =item aio_mtouch $scalar, $offset = 0, $length = undef, flags = 0, $callback->($status) @@ -2090,15 +2090,19 @@ given C<$scalar>, which will act like a string scalar. Returns true on success, and false otherwise. -The only operations allowed on the scalar are C/C that don't -change the string length, and most read-only operations such as copying it -or searching it with regexes and so on. +The scalar must exist, but its contents do not matter - this means you +cannot use a nonexistant array or hash element. When in doubt, C +the scalar first. + +The only operations allowed on the mmapped scalar are C/C, +which don't change the string length, and most read-only operations such +as copying it or searching it with regexes and so on. Anything else is unsafe and will, at best, result in memory leaks. The memory map associated with the C<$scalar> is automatically removed -when the C<$scalar> is destroyed, or when the C or -C functions are called. +when the C<$scalar> is undef'd or destroyed, or when the C +or C functions are called on it. This calls the C(2) function internally. See your system's manual page for details on the C<$length>, C<$prot> and C<$flags> parameters.