--- IO-AIO/AIO.pm 2007/06/03 09:44:17 1.109 +++ IO-AIO/AIO.pm 2007/09/20 14:06:21 1.113 @@ -197,7 +197,7 @@ aio_lstat aio_unlink aio_rmdir aio_readdir aio_scandir aio_symlink aio_readlink aio_fsync aio_fdatasync 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_chown aio_chmod aio_utime aio_truncate); our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice aio_block)); our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush min_parallel max_parallel max_idle @@ -331,8 +331,9 @@ callback without the actual number of bytes read (or -1 on error, just like the syscall). -If C<$offset> is undefined, then the current file offset will be used (and -updated), otherwise the file offset will not be changed by these calls. +If C<$offset> is undefined, then the current file descriptor offset will +be used (and updated), otherwise the file descriptor offset will not be +changed by these calls. If C<$length> is undefined in C, use the remaining length of C<$data>. @@ -445,6 +446,11 @@ aio_chown "path", 0, undef; +=item aio_truncate $fh_or_path, $offset, $callback->($status) + +Works like truncate(2) or ftruncate(2). + + =item aio_chmod $fh_or_path, $mode, $callback->($status) Works like perl's C function. @@ -1203,7 +1209,7 @@ use an C together with a feed callback. Sets the maximum number of outstanding requests to C<$nreqs>. If you -to queue up more than this number of requests, the next call to the +do queue up more than this number of requests, the next call to the C (and C and other functions calling C) function will block until the limit is no longer exceeded. @@ -1292,7 +1298,7 @@ scalars and other data passed into aio requests will also be locked and will consume memory till the request has entered the done state. -This is now awfully much, so queuing lots of requests is not usually a +This is not awfully much, so queuing lots of requests is not usually a problem. Per-thread usage: