ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.pm
(Generate patch)

Comparing IO-AIO/AIO.pm (file contents):
Revision 1.284 by root, Fri Mar 23 01:14:08 2018 UTC vs.
Revision 1.285 by root, Tue Jul 17 23:20:08 2018 UTC

171use common::sense; 171use common::sense;
172 172
173use base 'Exporter'; 173use base 'Exporter';
174 174
175BEGIN { 175BEGIN {
176 our $VERSION = 4.4; 176 our $VERSION = 4.41;
177 177
178 our @AIO_REQ = qw(aio_sendfile aio_seek aio_read aio_write aio_open aio_close 178 our @AIO_REQ = qw(aio_sendfile aio_seek aio_read aio_write aio_open aio_close
179 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx 179 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx
180 aio_scandir aio_symlink aio_readlink aio_realpath aio_fcntl aio_ioctl 180 aio_scandir aio_symlink aio_readlink aio_realpath aio_fcntl aio_ioctl
181 aio_sync aio_fsync aio_syncfs aio_fdatasync aio_sync_file_range 181 aio_sync aio_fsync aio_syncfs aio_fdatasync aio_sync_file_range
192 our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush 192 our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush
193 min_parallel max_parallel max_idle idle_timeout 193 min_parallel max_parallel max_idle idle_timeout
194 nreqs nready npending nthreads 194 nreqs nready npending nthreads
195 max_poll_time max_poll_reqs 195 max_poll_time max_poll_reqs
196 sendfile fadvise madvise 196 sendfile fadvise madvise
197 mmap munmap munlock munlockall); 197 mmap munmap mremap munlock munlockall);
198 198
199 push @AIO_REQ, qw(aio_busy); # not exported 199 push @AIO_REQ, qw(aio_busy); # not exported
200 200
201 @IO::AIO::GRP::ISA = 'IO::AIO::REQ'; 201 @IO::AIO::GRP::ISA = 'IO::AIO::REQ';
202 202
285 285
286 IO::AIO::sendfile $ofh, $ifh, $offset, $count 286 IO::AIO::sendfile $ofh, $ifh, $offset, $count
287 IO::AIO::fadvise $fh, $offset, $len, $advice 287 IO::AIO::fadvise $fh, $offset, $len, $advice
288 IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]] 288 IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]]
289 IO::AIO::munmap $scalar 289 IO::AIO::munmap $scalar
290 IO::AIO::mremap $scalar, $new_length, $flags[, $new_address]
290 IO::AIO::madvise $scalar, $offset, $length, $advice 291 IO::AIO::madvise $scalar, $offset, $length, $advice
291 IO::AIO::mprotect $scalar, $offset, $length, $protect 292 IO::AIO::mprotect $scalar, $offset, $length, $protect
292 IO::AIO::munlock $scalar, $offset = 0, $length = undef 293 IO::AIO::munlock $scalar, $offset = 0, $length = undef
293 IO::AIO::munlockall 294 IO::AIO::munlockall
294 295
2158 2159
2159=item IO::AIO::munmap $scalar 2160=item IO::AIO::munmap $scalar
2160 2161
2161Removes a previous mmap and undefines the C<$scalar>. 2162Removes a previous mmap and undefines the C<$scalar>.
2162 2163
2164=item IO::AIO::mremap $scalar, $new_length, $flags = 0[, $new_address = 0]
2165
2166Calls the Linux-specific mremap(2) system call. The C<$scalar> must have
2167been mapped by C<IO::AIO::mmap>, and C<$flags> must currently either be
2168C<0> or C<IO::AIO::MREMAP_MAYMOVE>.
2169
2170Returns true if successful, and false otherwise. If the underlying mmapped
2171region has changed address, then the true value has the numerical value
2172C<1>, otherwise it has the numerical value C<0>:
2173
2174 my $success = IO::AIO::mremap $mmapped, 8192, IO::AIO::MREMAP_MAYMOVE
2175 or die "mremap: $!";
2176
2177 if ($success*1) {
2178 warn "scalar has chanegd address in memory\n";
2179 }
2180
2181C<IO::AIO::MREMAP_FIXED> and the C<$new_address> argument are currently
2182implemented, but not supported and might go away in a future version.
2183
2184On systems where this call is not supported or is not emulated, this call
2185returns falls and sets C<$!> to C<ENOSYS>.
2186
2163=item IO::AIO::munlock $scalar, $offset = 0, $length = undef 2187=item IO::AIO::munlock $scalar, $offset = 0, $length = undef
2164 2188
2165Calls the C<munlock> function, undoing the effects of a previous 2189Calls the C<munlock> function, undoing the effects of a previous
2166C<aio_mlock> call (see its description for details). 2190C<aio_mlock> call (see its description for details).
2167 2191

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines