ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.pm
(Generate patch)

Comparing IO-AIO/AIO.pm (file contents):
Revision 1.304 by root, Wed Apr 3 03:11:45 2019 UTC vs.
Revision 1.305 by root, Fri Sep 6 22:03:08 2019 UTC

171use common::sense; 171use common::sense;
172 172
173use base 'Exporter'; 173use base 'Exporter';
174 174
175BEGIN { 175BEGIN {
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]
2397Calls the C<munlockall> function. 2398Calls the C<munlockall> function.
2398 2399
2399On systems that do not implement C<munlockall>, this function returns 2400On systems that do not implement C<munlockall>, this function returns
2400ENOSYS, otherwise the return value of C<munlockall>. 2401ENOSYS, otherwise the return value of C<munlockall>.
2401 2402
2403=item $fh = IO::AIO::accept4 $r_fh, $sockaddr, $sockaddr_maxlen, $flags
2404
2405Uses the GNU/Linux C<accept4(2)> syscall, if available, to accept a socket
2406and return the new file handle on success, or sets C<$!> and returns
2407C<undef> on error.
2408
2409The remote name of the new socket will be stored in C<$sockaddr>, which
2410will be extended to allow for at least C<$sockaddr_maxlen> octets. If the
2411socket name does not fit into C<$sockaddr_maxlen> octets, this is signaled
2412by returning a longer string in C<$sockaddr>, which might or might not be
2413truncated.
2414
2415To accept name-less sockets, use C<undef> for C<$sockaddr> and C<0> for
2416C<$sockaddr_maxlen>.
2417
2418The main reasons to use this syscall rather than portable C«accept(2)>
2419are that you can specify C<SOCK_NONBLOCK> and/or C<SOCK_CLOEXEC>
2420flags and you can accept name-less sockets by specifying C<0> for
2421C<$sockaddr_maxlen>, which is sadly not possible with perl's interface to
2422C<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
2404Calls the GNU/Linux C<splice(2)> syscall, if available. If C<$r_off> or 2426Calls the GNU/Linux C<splice(2)> syscall, if available. If C<$r_off> or
2405C<$w_off> are C<undef>, then C<NULL> is passed for these, otherwise they 2427C<$w_off> are C<undef>, then C<NULL> is passed for these, otherwise they
2406should be the file offset. 2428should be the file offset.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines