X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSyscall.pm;h=530ee93bbb39a88e4be4415810bb5a87845a83e1;hb=refs%2Fheads%2Fmaster;hp=bda9bbb049f3ed1a62030b8f563accef16572838;hpb=d8f49eed19346690c33f5d9da5fbaf041f065f0f;p=public-inbox.git diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm index bda9bbb0..530ee93b 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, @@ -102,7 +87,9 @@ if ($^O eq "linux") { # if we're running on an x86_64 kernel, but a 32-bit process, # we need to use the x32 or i386 syscall numbers. if ($machine eq 'x86_64') { - $machine = $Config{cppsymbols} =~ /\b__ILP32__=1\b/ ? 'x32' : 'i386' + my $s = $Config{cppsymbols}; + $machine = ($s =~ /\b__ILP32__=1\b/ && $s =~ /\b__x86_64__=1\b/) ? + 'x32' : 'i386' } elsif ($machine eq 'mips64') { # similarly for mips64 vs mips $machine = 'mips'; } @@ -256,19 +243,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 <