… | |
… | |
2215 | |
2215 | |
2216 | Please refer to L<pipe2(2)> for more info on the C<$flags>, but at the |
2216 | Please refer to L<pipe2(2)> for more info on the C<$flags>, but at the |
2217 | time of this writing, C<IO::AIO::O_CLOEXEC>, C<IO::AIO::O_NONBLOCK> and |
2217 | time of this writing, C<IO::AIO::O_CLOEXEC>, C<IO::AIO::O_NONBLOCK> and |
2218 | C<IO::AIO::O_DIRECT> (Linux 3.4, for packet-based pipes) were supported. |
2218 | C<IO::AIO::O_DIRECT> (Linux 3.4, for packet-based pipes) were supported. |
2219 | |
2219 | |
|
|
2220 | Example: create a pipe race-free w.r.t. threads and fork: |
|
|
2221 | |
|
|
2222 | my ($rfh, $wfh) = IO::AIO::pipe2 IO::AIO::O_CLOEXEC |
|
|
2223 | or die "pipe2: $!\n"; |
|
|
2224 | |
|
|
2225 | =item $fh = IO::AIO::eventfd ([$initval, [$flags]]) |
|
|
2226 | |
|
|
2227 | This is a direct interface to the Linux L<eventfd(2)> system call. The |
|
|
2228 | (unhelpful) defaults for C<$initval> and C<$flags> are C<0> for both. |
|
|
2229 | |
|
|
2230 | On success, the new eventfd filehandle is returned, otherwise returns |
|
|
2231 | C<undef>. If the eventfd syscall is missing, fails with C<ENOSYS>. |
|
|
2232 | |
|
|
2233 | Please refer to L<eventfd(2)> for more info on this call. |
|
|
2234 | |
|
|
2235 | The following symbol flag values are available: C<IO::AIO::EFD_CLOEXEC>, |
|
|
2236 | C<IO::AIO::EFD_NONBLOCK> and C<IO::AIO::EFD_SEMAPHORE> (Linux 2.6.30). |
|
|
2237 | |
2220 | =back |
2238 | =back |
2221 | |
2239 | |
2222 | =cut |
2240 | =cut |
2223 | |
2241 | |
2224 | min_parallel 8; |
2242 | min_parallel 8; |