… | |
… | |
221 | IO::AIO::idle_timeout $seconds |
221 | IO::AIO::idle_timeout $seconds |
222 | IO::AIO::max_outstanding $maxreqs |
222 | IO::AIO::max_outstanding $maxreqs |
223 | IO::AIO::nreqs |
223 | IO::AIO::nreqs |
224 | IO::AIO::nready |
224 | IO::AIO::nready |
225 | IO::AIO::npending |
225 | IO::AIO::npending |
|
|
226 | IO::AIO::reinit |
|
|
227 | |
226 | $nfd = IO::AIO::get_fdlimit [EXPERIMENTAL] |
228 | $nfd = IO::AIO::get_fdlimit [EXPERIMENTAL] |
227 | IO::AIO::min_fdlimit $nfd [EXPERIMENTAL] |
229 | IO::AIO::min_fdlimit $nfd [EXPERIMENTAL] |
228 | |
230 | |
229 | IO::AIO::sendfile $ofh, $ifh, $offset, $count |
231 | IO::AIO::sendfile $ofh, $ifh, $offset, $count |
230 | IO::AIO::fadvise $fh, $offset, $len, $advice |
232 | IO::AIO::fadvise $fh, $offset, $len, $advice |
|
|
233 | |
231 | IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]] |
234 | IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]] |
232 | IO::AIO::munmap $scalar |
235 | IO::AIO::munmap $scalar |
233 | IO::AIO::mremap $scalar, $new_length, $flags[, $new_address] |
236 | IO::AIO::mremap $scalar, $new_length, $flags[, $new_address] |
234 | IO::AIO::madvise $scalar, $offset, $length, $advice |
237 | IO::AIO::madvise $scalar, $offset, $length, $advice |
235 | IO::AIO::mprotect $scalar, $offset, $length, $protect |
238 | IO::AIO::mprotect $scalar, $offset, $length, $protect |
236 | IO::AIO::munlock $scalar, $offset = 0, $length = undef |
239 | IO::AIO::munlock $scalar, $offset = 0, $length = undef |
237 | IO::AIO::munlockall |
240 | IO::AIO::munlockall |
|
|
241 | |
|
|
242 | # stat extensions |
|
|
243 | $counter = IO::AIO::st_gen |
|
|
244 | $seconds = IO::AIO::st_atime, IO::AIO::st_mtime, IO::AIO::st_ctime, IO::AIO::st_btime |
|
|
245 | ($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtime |
|
|
246 | $nanoseconds = IO::AIO::st_atimensec, IO::AIO::st_mtimensec, IO::AIO::st_ctimensec, IO::AIO::st_btimensec |
|
|
247 | $seconds = IO::AIO::st_btimesec |
|
|
248 | ($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtimensec |
|
|
249 | |
|
|
250 | # very much unportable syscalls |
|
|
251 | IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags |
|
|
252 | IO::AIO::tee $r_fh, $w_fh, $length, $flags |
|
|
253 | $actual_size = IO::AIO::pipesize $r_fh[, $new_size] |
|
|
254 | ($rfh, $wfh) = IO::AIO::pipe2 [$flags] |
|
|
255 | $fh = IO::AIO::memfd_create $pathname[, $flags] |
|
|
256 | $fh = IO::AIO::eventfd [$initval, [$flags]] |
|
|
257 | $fh = IO::AIO::timerfd_create $clockid[, $flags] |
|
|
258 | ($cur_interval, $cur_value) = IO::AIO::timerfd_settime $fh, $flags, $new_interval, $nbw_value |
|
|
259 | ($cur_interval, $cur_value) = IO::AIO::timerfd_gettime $fh |
238 | |
260 | |
239 | API NOTES |
261 | API NOTES |
240 | All the "aio_*" calls are more or less thin wrappers around the syscall |
262 | All the "aio_*" calls are more or less thin wrappers around the syscall |
241 | with the same name (sans "aio_"). The arguments are similar or |
263 | with the same name (sans "aio_"). The arguments are similar or |
242 | identical, and they all accept an additional (and optional) $callback |
264 | identical, and they all accept an additional (and optional) $callback |
… | |
… | |
1641 | below, for full accuracy. |
1663 | below, for full accuracy. |
1642 | |
1664 | |
1643 | File birth time is only available when the OS and perl support it |
1665 | File birth time is only available when the OS and perl support it |
1644 | (on FreeBSD and NetBSD at the time of this writing, although support |
1666 | (on FreeBSD and NetBSD at the time of this writing, although support |
1645 | is adaptive, so if your OS/perl gains support, IO::AIO can take |
1667 | is adaptive, so if your OS/perl gains support, IO::AIO can take |
1646 | avdantage of it). On systems where it isn't available, 0 is |
1668 | advantage of it). On systems where it isn't available, 0 is |
1647 | currently returned, but this might change to "undef" in a future |
1669 | currently returned, but this might change to "undef" in a future |
1648 | version. |
1670 | version. |
1649 | |
1671 | |
1650 | ($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtime |
1672 | ($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtime |
1651 | Returns access, modification, change and birth time all in one go, |
1673 | Returns access, modification, change and birth time all in one go, |
… | |
… | |
1917 | Example: create a pipe race-free w.r.t. threads and fork: |
1939 | Example: create a pipe race-free w.r.t. threads and fork: |
1918 | |
1940 | |
1919 | my ($rfh, $wfh) = IO::AIO::pipe2 IO::AIO::O_CLOEXEC |
1941 | my ($rfh, $wfh) = IO::AIO::pipe2 IO::AIO::O_CLOEXEC |
1920 | or die "pipe2: $!\n"; |
1942 | or die "pipe2: $!\n"; |
1921 | |
1943 | |
|
|
1944 | $fh = IO::AIO::memfd_create $pathname[, $flags] |
|
|
1945 | This is a direct interface to the Linux memfd_create(2) system call. |
|
|
1946 | The (unhelpful) default for $flags is 0, but your default should be |
|
|
1947 | "IO::AIO::MFD_CLOEXEC". |
|
|
1948 | |
|
|
1949 | On success, the new memfd filehandle is returned, otherwise returns |
|
|
1950 | "undef". If the memfd_create syscall is missing, fails with |
|
|
1951 | "ENOSYS". |
|
|
1952 | |
|
|
1953 | Please refer to memfd_create(2) for more info on this call. |
|
|
1954 | |
|
|
1955 | The following $flags values are available: "IO::AIO::MFD_CLOEXEC", |
|
|
1956 | "IO::AIO::MFD_ALLOW_SEALING" and "IO::AIO::MFD_HUGETLB". |
|
|
1957 | |
|
|
1958 | Example: create a new memfd. |
|
|
1959 | |
|
|
1960 | my $fh = IO::AIO::memfd_create "somenameforprocfd", IO::AIO::MFD_CLOEXEC |
|
|
1961 | or die "m,emfd_create: $!\n"; |
1922 | $fh = IO::AIO::eventfd [$initval, [$flags]] |
1962 | =item $fh = IO::AIO::eventfd [$initval, [$flags]] |
|
|
1963 | |
1923 | This is a direct interface to the Linux eventfd(2) system call. The |
1964 | This is a direct interface to the Linux eventfd(2) system call. The |
1924 | (unhelpful) defaults for $initval and $flags are 0 for both. |
1965 | (unhelpful) defaults for $initval and $flags are 0 for both. |
1925 | |
1966 | |
1926 | On success, the new eventfd filehandle is returned, otherwise |
1967 | On success, the new eventfd filehandle is returned, otherwise |
1927 | returns "undef". If the eventfd syscall is missing, fails with |
1968 | returns "undef". If the eventfd syscall is missing, fails with |
… | |
… | |
1933 | "IO::AIO::EFD_CLOEXEC", "IO::AIO::EFD_NONBLOCK" and |
1974 | "IO::AIO::EFD_CLOEXEC", "IO::AIO::EFD_NONBLOCK" and |
1934 | "IO::AIO::EFD_SEMAPHORE" (Linux 2.6.30). |
1975 | "IO::AIO::EFD_SEMAPHORE" (Linux 2.6.30). |
1935 | |
1976 | |
1936 | Example: create a new eventfd filehandle: |
1977 | Example: create a new eventfd filehandle: |
1937 | |
1978 | |
1938 | $fh = IO::AIO::eventfd 0, IO::AIO::O_CLOEXEC |
1979 | $fh = IO::AIO::eventfd 0, IO::AIO::EFD_CLOEXEC |
1939 | or die "eventfd: $!\n"; |
1980 | or die "eventfd: $!\n"; |
1940 | |
1981 | |
1941 | $fh = IO::AIO::timerfd_create $clockid[, $flags] |
1982 | $fh = IO::AIO::timerfd_create $clockid[, $flags] |
1942 | This is a direct interface to the Linux timerfd_create(2) system |
1983 | This is a direct interface to the Linux timerfd_create(2) system |
1943 | call. The (unhelpful) default for $flags is 0. |
1984 | call. The (unhelpful) default for $flags is 0, but your default |
|
|
1985 | should be "IO::AIO::TFD_CLOEXEC". |
1944 | |
1986 | |
1945 | On success, the new timerfd filehandle is returned, otherwise |
1987 | On success, the new timerfd filehandle is returned, otherwise |
1946 | returns "undef". If the eventfd syscall is missing, fails with |
1988 | returns "undef". If the timerfd_create syscall is missing, fails |
1947 | "ENOSYS". |
1989 | with "ENOSYS". |
1948 | |
1990 | |
1949 | Please refer to timerfd_create(2) for more info on this call. |
1991 | Please refer to timerfd_create(2) for more info on this call. |
1950 | |
1992 | |
1951 | The following $clockid values are available: |
1993 | The following $clockid values are available: |
1952 | "IO::AIO::CLOCK_REALTIME", "IO::AIO::CLOCK_MONOTONIC" |
1994 | "IO::AIO::CLOCK_REALTIME", "IO::AIO::CLOCK_MONOTONIC" |