--- IO-AIO/AIO.pm 2019/04/03 03:11:45 1.304 +++ IO-AIO/AIO.pm 2019/09/06 22:03:08 1.305 @@ -173,7 +173,7 @@ use base 'Exporter'; BEGIN { - our $VERSION = 4.72; + our $VERSION = 4.73; our @AIO_REQ = qw(aio_sendfile aio_seek aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx @@ -305,6 +305,7 @@ ($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtimensec # very much unportable syscalls + IO::AIO::accept4 $r_fh, $sockaddr, $sockaddr_len, $flags IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags IO::AIO::tee $r_fh, $w_fh, $length, $flags $actual_size = IO::AIO::pipesize $r_fh[, $new_size] @@ -2399,6 +2400,27 @@ On systems that do not implement C, this function returns ENOSYS, otherwise the return value of C. +=item $fh = IO::AIO::accept4 $r_fh, $sockaddr, $sockaddr_maxlen, $flags + +Uses the GNU/Linux C syscall, if available, to accept a socket +and return the new file handle on success, or sets C<$!> and returns +C on error. + +The remote name of the new socket will be stored in C<$sockaddr>, which +will be extended to allow for at least C<$sockaddr_maxlen> octets. If the +socket name does not fit into C<$sockaddr_maxlen> octets, this is signaled +by returning a longer string in C<$sockaddr>, which might or might not be +truncated. + +To accept name-less sockets, use C for C<$sockaddr> and C<0> for +C<$sockaddr_maxlen>. + +The main reasons to use this syscall rather than portable C«accept(2)> +are that you can specify C and/or C +flags and you can accept name-less sockets by specifying C<0> for +C<$sockaddr_maxlen>, which is sadly not possible with perl's interface to +C. + =item IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags Calls the GNU/Linux C syscall, if available. If C<$r_off> or