… | |
… | |
275 | Or in other words: the file descriptor will be closed, but it will |
275 | Or in other words: the file descriptor will be closed, but it will |
276 | not be free for reuse until the perl filehandle is closed. |
276 | not be free for reuse until the perl filehandle is closed. |
277 | |
277 | |
278 | aio_read $fh,$offset,$length, $data,$dataoffset, $callback->($retval) |
278 | aio_read $fh,$offset,$length, $data,$dataoffset, $callback->($retval) |
279 | aio_write $fh,$offset,$length, $data,$dataoffset, $callback->($retval) |
279 | aio_write $fh,$offset,$length, $data,$dataoffset, $callback->($retval) |
280 | Reads or writes $length bytes from the specified $fh and $offset |
280 | Reads or writes $length bytes from or to the specified $fh and |
281 | into the scalar given by $data and offset $dataoffset and calls the |
281 | $offset into the scalar given by $data and offset $dataoffset and |
282 | callback without the actual number of bytes read (or -1 on error, |
282 | calls the callback without the actual number of bytes read (or -1 on |
283 | just like the syscall). |
283 | error, just like the syscall). |
|
|
284 | |
|
|
285 | "aio_read" will, like "sysread", shrink or grow the $data scalar to |
|
|
286 | offset plus the actual number of bytes read. |
284 | |
287 | |
285 | If $offset is undefined, then the current file descriptor offset |
288 | If $offset is undefined, then the current file descriptor offset |
286 | will be used (and updated), otherwise the file descriptor offset |
289 | will be used (and updated), otherwise the file descriptor offset |
287 | will not be changed by these calls. |
290 | will not be changed by these calls. |
288 | |
291 | |
… | |
… | |
542 | callback with the fdatasync result code. |
545 | callback with the fdatasync result code. |
543 | |
546 | |
544 | If this call isn't available because your OS lacks it or it couldn't |
547 | If this call isn't available because your OS lacks it or it couldn't |
545 | be detected, it will be emulated by calling "fsync" instead. |
548 | be detected, it will be emulated by calling "fsync" instead. |
546 | |
549 | |
|
|
550 | aio_sync_file_range $fh, $offset, $nbytes, $flags, $callback->($status) |
|
|
551 | Sync the data portion of the file specified by $offset and $length |
|
|
552 | to disk (but NOT the metadata), by calling the Linux-specific |
|
|
553 | sync_file_range call. If sync_file_range is not available or it |
|
|
554 | returns ENOSYS, then fdatasync or fsync is being substituted. |
|
|
555 | |
|
|
556 | $flags can be a combination of |
|
|
557 | "IO::AIO::SYNC_FILE_RANGE_WAIT_BEFORE", |
|
|
558 | "IO::AIO::SYNC_FILE_RANGE_WRITE" and |
|
|
559 | "IO::AIO::SYNC_FILE_RANGE_WAIT_AFTER": refer to the sync_file_range |
|
|
560 | manpage for details. |
|
|
561 | |
547 | aio_pathsync $path, $callback->($status) |
562 | aio_pathsync $path, $callback->($status) |
548 | This request tries to open, fsync and close the given path. This is |
563 | This request tries to open, fsync and close the given path. This is |
549 | a composite request intended to sync directories after directory |
564 | a composite request intended to sync directories after directory |
550 | operations (E.g. rename). This might not work on all operating |
565 | operations (E.g. rename). This might not work on all operating |
551 | systems or have any specific effect, but usually it makes sure that |
566 | systems or have any specific effect, but usually it makes sure that |