… | |
… | |
1385 | IO::AIO::mmap $data, -s $fh, IO::AIO::PROT_READ, IO::AIO::MAP_SHARED, $fh; |
1385 | IO::AIO::mmap $data, -s $fh, IO::AIO::PROT_READ, IO::AIO::MAP_SHARED, $fh; |
1386 | aio_mlock $data; # mlock in background |
1386 | aio_mlock $data; # mlock in background |
1387 | |
1387 | |
1388 | =item aio_mlockall $flags, $callback->($status) |
1388 | =item aio_mlockall $flags, $callback->($status) |
1389 | |
1389 | |
1390 | Calls the C<mlockall> function with the given C<$flags> (a combination of |
1390 | Calls the C<mlockall> function with the given C<$flags> (a |
1391 | C<IO::AIO::MCL_CURRENT> and C<IO::AIO::MCL_FUTURE>). |
1391 | combination of C<IO::AIO::MCL_CURRENT>, C<IO::AIO::MCL_FUTURE> and |
|
|
1392 | C<IO::AIO::MCL_ONFAULT>). |
1392 | |
1393 | |
1393 | On systems that do not implement C<mlockall>, this function returns C<-1> |
1394 | On systems that do not implement C<mlockall>, this function returns C<-1> |
1394 | and sets errno to C<ENOSYS>. |
1395 | and sets errno to C<ENOSYS>. Similarly, flag combinations not supported |
|
|
1396 | by the system result in a return value of C<-1> with errno being set to |
|
|
1397 | C<EINVAL>. |
1395 | |
1398 | |
1396 | Note that the corresponding C<munlockall> is synchronous and is |
1399 | Note that the corresponding C<munlockall> is synchronous and is |
1397 | documented under L<MISCELLANEOUS FUNCTIONS>. |
1400 | documented under L<MISCELLANEOUS FUNCTIONS>. |
1398 | |
1401 | |
1399 | Example: asynchronously lock all current and future pages into memory. |
1402 | Example: asynchronously lock all current and future pages into memory. |