File: aio_test_common.pm

package info (click to toggle)
libio-aio-perl 2.4-1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 356 kB
  • ctags: 76
  • sloc: perl: 413; ansic: 97; makefile: 50
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;