File: aio_test_common.pm

package info (click to toggle)
libio-aio-perl 4.81-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 988 kB
  • sloc: ansic: 5,008; perl: 603; makefile: 11; sh: 2
file content (25 lines) | stat: -rw-r--r-- 406 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use IO::AIO;

package aio_test_common;

use strict;
require Exporter;
use vars qw(@ISA @EXPORT);
use File::Temp ();

@ISA = qw(Exporter);
@EXPORT = qw(pcb tempdir);

sub tempdir {
    return File::Temp::tempdir( CLEANUP => 1 );
}

sub pcb {
    while (IO::AIO::nreqs) {
        my $rfd = ""; vec ($rfd, IO::AIO::poll_fileno, 1) = 1; select $rfd, undef, undef, undef;
        IO::AIO::poll_cb;
    }
}

1;