lib/PublicInbox/Syscall.pm | 34 ++++++---------------------------- diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm index bda9bbb049f3ed1a62030b8f563accef16572838..cecb12476cefcf7bfe44919d881c9a408899bb76 100644 --- a/lib/PublicInbox/Syscall.pm +++ b/lib/PublicInbox/Syscall.pm @@ -60,21 +60,6 @@ SIZEOF_cmsghdr => SIZEOF_int * 2 + SIZEOF_size_t, }; 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 @@ $FS_IOC_GETFLAGS = 0x40046601; $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 <