2 # Copyright (C) all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
7 use PublicInbox::Syscall qw(EPOLLOUT);
8 plan skip_all => 'not Linux' if $^O ne 'linux';
9 require_ok 'PublicInbox::Epoll';
10 my $ep = PublicInbox::Epoll->new;
12 is($ep->ep_add($w, EPOLLOUT), 0, 'epoll_ctl pipe EPOLLOUT');
15 $ep->ep_wait(10000, \@events);
16 is(scalar(@events), 1, 'got one event');
17 is($events[0], fileno($w), 'got expected FD');
19 $ep->ep_wait(0, \@events);
20 is(scalar(@events), 0, 'epoll_wait timeout');