… | |
… | |
171 | use common::sense; |
171 | use common::sense; |
172 | |
172 | |
173 | use base 'Exporter'; |
173 | use base 'Exporter'; |
174 | |
174 | |
175 | BEGIN { |
175 | BEGIN { |
176 | our $VERSION = 4.72; |
176 | our $VERSION = 4.73; |
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 |
… | |
… | |
303 | $nanoseconds = IO::AIO::st_atimensec, IO::AIO::st_mtimensec, IO::AIO::st_ctimensec, IO::AIO::st_btimensec |
303 | $nanoseconds = IO::AIO::st_atimensec, IO::AIO::st_mtimensec, IO::AIO::st_ctimensec, IO::AIO::st_btimensec |
304 | $seconds = IO::AIO::st_btimesec |
304 | $seconds = IO::AIO::st_btimesec |
305 | ($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtimensec |
305 | ($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtimensec |
306 | |
306 | |
307 | # very much unportable syscalls |
307 | # very much unportable syscalls |
|
|
308 | IO::AIO::accept4 $r_fh, $sockaddr, $sockaddr_len, $flags |
308 | IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags |
309 | IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags |
309 | IO::AIO::tee $r_fh, $w_fh, $length, $flags |
310 | IO::AIO::tee $r_fh, $w_fh, $length, $flags |
310 | $actual_size = IO::AIO::pipesize $r_fh[, $new_size] |
311 | $actual_size = IO::AIO::pipesize $r_fh[, $new_size] |
311 | ($rfh, $wfh) = IO::AIO::pipe2 [$flags] |
312 | ($rfh, $wfh) = IO::AIO::pipe2 [$flags] |
312 | $fh = IO::AIO::memfd_create $pathname[, $flags] |
313 | $fh = IO::AIO::memfd_create $pathname[, $flags] |
… | |
… | |
2397 | Calls the C<munlockall> function. |
2398 | Calls the C<munlockall> function. |
2398 | |
2399 | |
2399 | On systems that do not implement C<munlockall>, this function returns |
2400 | On systems that do not implement C<munlockall>, this function returns |
2400 | ENOSYS, otherwise the return value of C<munlockall>. |
2401 | ENOSYS, otherwise the return value of C<munlockall>. |
2401 | |
2402 | |
|
|
2403 | =item $fh = IO::AIO::accept4 $r_fh, $sockaddr, $sockaddr_maxlen, $flags |
|
|
2404 | |
|
|
2405 | Uses the GNU/Linux C<accept4(2)> syscall, if available, to accept a socket |
|
|
2406 | and return the new file handle on success, or sets C<$!> and returns |
|
|
2407 | C<undef> on error. |
|
|
2408 | |
|
|
2409 | The remote name of the new socket will be stored in C<$sockaddr>, which |
|
|
2410 | will be extended to allow for at least C<$sockaddr_maxlen> octets. If the |
|
|
2411 | socket name does not fit into C<$sockaddr_maxlen> octets, this is signaled |
|
|
2412 | by returning a longer string in C<$sockaddr>, which might or might not be |
|
|
2413 | truncated. |
|
|
2414 | |
|
|
2415 | To accept name-less sockets, use C<undef> for C<$sockaddr> and C<0> for |
|
|
2416 | C<$sockaddr_maxlen>. |
|
|
2417 | |
|
|
2418 | The main reasons to use this syscall rather than portable C«accept(2)> |
|
|
2419 | are that you can specify C<SOCK_NONBLOCK> and/or C<SOCK_CLOEXEC> |
|
|
2420 | flags and you can accept name-less sockets by specifying C<0> for |
|
|
2421 | C<$sockaddr_maxlen>, which is sadly not possible with perl's interface to |
|
|
2422 | C<accept>. |
|
|
2423 | |
2402 | =item IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags |
2424 | =item IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags |
2403 | |
2425 | |
2404 | Calls the GNU/Linux C<splice(2)> syscall, if available. If C<$r_off> or |
2426 | Calls the GNU/Linux C<splice(2)> syscall, if available. If C<$r_off> or |
2405 | C<$w_off> are C<undef>, then C<NULL> is passed for these, otherwise they |
2427 | C<$w_off> are C<undef>, then C<NULL> is passed for these, otherwise they |
2406 | should be the file offset. |
2428 | should be the file offset. |