From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BE3C11F461; Mon, 24 Jun 2019 05:24:53 +0000 (UTC) Date: Mon, 24 Jun 2019 05:24:53 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Re: [PATCH 54/57] ds: split out IO::KQueue-specific code Message-ID: <20190624052453.qhrhlemienxhhyuy@dcvr> References: <20190624025258.25592-1-e@80x24.org> <20190624025258.25592-55-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190624025258.25592-55-e@80x24.org> List-Id: Eric Wong wrote: > diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm > index f1988e61..f53f3c82 100644 > --- a/lib/PublicInbox/Syscall.pm > +++ b/lib/PublicInbox/Syscall.pm > @@ -248,14 +248,7 @@ sub sendfile_freebsd { > > sub epoll_defined { return $SYS_epoll_create ? 1 : 0; } > > -# ARGS: (size) -- but in modern Linux 2.6, the > -# size doesn't even matter (radix tree now, not hash) > -sub epoll_create { > - return -1 unless defined $SYS_epoll_create; > - my $epfd = eval { syscall($SYS_epoll_create, $no_deprecated ? 0 : ($_[0]||100)+0) }; > - return -1 if $@; > - return $epfd; > -} > +sub epoll_create { syscall($SYS_epoll_create, 0) } Oops, that wasn't tested on Linux, actually :x I got too focused on FreeBSD-related improvements that I forgot to test on the OS I mainly use :x Will squash this before pushing diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm index f53f3c8..500efa6 100644 --- a/lib/PublicInbox/Syscall.pm +++ b/lib/PublicInbox/Syscall.pm @@ -248,7 +248,9 @@ sub sendfile_freebsd { sub epoll_defined { return $SYS_epoll_create ? 1 : 0; } -sub epoll_create { syscall($SYS_epoll_create, 0) } +sub epoll_create { + syscall($SYS_epoll_create, $no_deprecated ? 0 : ($_[0]||100)+0); +} # epoll_ctl wrapper # ARGS: (epfd, op, fd, events_mask)