# This license differs from the rest of public-inbox
#
# This module is Copyright (c) 2005 Six Apart, Ltd.
-# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
#
# All rights reserved.
#
$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
- return $rv;
+ $rv;
}
*epoll_ctl = \&epoll_ctl_mod4;
}
}
-
-elsif ($^O eq "freebsd") {
- if ($ENV{FREEBSD_SENDFILE}) {
- # this is still buggy and in development
- }
-}
+# use Inline::C for *BSD-only or general POSIX stuff.
+# Linux guarantees stable syscall numbering, BSDs only offer a stable libc
+# use scripts/syscall-list on Linux to detect new syscall numbers
############################################################################
# epoll functions
############################################################################
-sub epoll_defined { return $SYS_epoll_create ? 1 : 0; }
+sub epoll_defined { $SYS_epoll_create ? 1 : 0; }
sub epoll_create {
- syscall($SYS_epoll_create, $no_deprecated ? 0 : ($_[0]||100)+0);
+ syscall($SYS_epoll_create, $no_deprecated ? 0 : 100);
}
# epoll_ctl wrapper
# epoll_wait wrapper
# ARGS: (epfd, maxevents, timeout (milliseconds), arrayref)
# arrayref: values modified to be [$fd, $event]
-our $epoll_wait_events;
+our $epoll_wait_events = '';
our $epoll_wait_size = 0;
sub epoll_wait_mod4 {
my ($epfd, $maxevents, $timeout_msec, $events) = @_;