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.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF 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 72C6C1F9FC for ; Fri, 23 Dec 2022 12:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1671799868; bh=8HzUk1ZRabSAD7OQT6J0QRwIum+2TIKKFbJ2b4/YxJU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JwKKWKMRvGB5X0O05oqcHJ0gle0UMpsoCekv2Hak9XLGHT4eAa1Njum0v6Dalvw2r VwRsbIcQVM/6Ph/kVNPAo2IYzTkN4SmM8A6zVPDjRokQQwdxa6B8MbfPWpEe6sU/60 jjOMxyf9PTYM7YG+cdqnLY9FiThVGrLIQPdM5qgs= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] syscall: drop syscall.ph support Date: Fri, 23 Dec 2022 12:51:08 +0000 Message-Id: <20221223125108.963997-3-e@80x24.org> In-Reply-To: <20221223125108.963997-1-e@80x24.org> References: <20221223125108.963997-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: h2ph-generated *.ph files are often wrong or incomplete and IME they cause more problems than they solve. Furthermore, we need knowledge of struct layouts which h2ph-generated files can't get us. So trim down some bloat and leave a note for porters. --- lib/PublicInbox/Syscall.pm | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm index bda9bbb0..cecb1247 100644 --- a/lib/PublicInbox/Syscall.pm +++ b/lib/PublicInbox/Syscall.pm @@ -60,21 +60,6 @@ use constant { }; my @BYTES_4_hole = BYTES_4_hole ? (0) : (); -our $loaded_syscall = 0; - -sub _load_syscall { - # props to Gaal for this! - return if $loaded_syscall++; - my $clean = sub { - delete @INC{qw}; - }; - $clean->(); # don't trust modules before us - my $rv = eval { require 'syscall.ph'; 1 } || eval { require 'sys/syscall.ph'; 1 }; - $clean->(); # don't require modules after us trust us - $rv; -} - our ( $SYS_epoll_create, @@ -256,19 +241,12 @@ if ($^O eq "linux") { $FS_IOC_SETFLAGS = 0x80046602; $SIGNUM{WINCH} = 20; } else { - # as a last resort, try using the *.ph files which may not - # exist or may be wrong - _load_syscall(); - $SYS_epoll_create = eval { &SYS_epoll_create; } || 0; - $SYS_epoll_ctl = eval { &SYS_epoll_ctl; } || 0; - $SYS_epoll_wait = eval { &SYS_epoll_wait; } || 0; - - # Note: do NOT add new syscalls to depend on *.ph, here. - # Better to miss syscalls (so we can fallback to IO::Poll) - # than to use wrong ones, since the names are not stable - # (at least not on FreeBSD), if the actual numbers are. + warn <