Commit 5d2801a9 authored by Jason Madden's avatar Jason Madden

Update libev to 4.31

Fixes #1504
parent a67a39f4
...@@ -14,6 +14,11 @@ Platform and Packaging Updates ...@@ -14,6 +14,11 @@ Platform and Packaging Updates
3.7.6 and 3.8.1. It is also tested with PyPy2 7.3 and PyPy 3.6 3.7.6 and 3.8.1. It is also tested with PyPy2 7.3 and PyPy 3.6
7.3. 7.3.
Library and Dependency Updates
------------------------------
- Upgrade libev from 4.25 to 4.31 and update its embedded
``config.guess`` to the latest.
1.5a3 (2020-01-01) 1.5a3 (2020-01-01)
================== ==================
......
Revision history for libev, a high-performance and full-featured event loop. Revision history for libev, a high-performance and full-featured event loop.
TODO: revisit 59.x timer in the light of modern powersaving
TODO: document EV_TSTAMP_T
4.31 Fri Dec 20 21:58:29 CET 2019
- handle backends with minimum wait time a bit better by not
waiting in the presence of already-expired timers
(behaviour reported by Felipe Gasper).
- new feature: use timerfd to detect timejumps quickly,
can be disabled with the new EVFLAG_NOTIMERFD loop flag.
- document EV_USE_SIGNALFD feature macro.
4.30 (EV only)
- change non-autoconf test for __kernel_rwf_t by testing
LINUX_VERSION_CODE, the most direct test I could find.
- fix a bug in the io_uring backend that polled the wrong
backend fd, causing it to not work in many cases.
4.29 (EV only)
- add io uring autoconf and non-autoconf detection.
- disable io_uring when some header files are too old.
4.28 (EV only)
- linuxaio backend resulted in random memory corruption
when loop is forked.
- linuxaio backend might have tried to cancel an iocb
multiple times (was unable to trigger this).
- linuxaio backend now employs a generation counter to
avoid handling spurious events from cancelled requests.
- io_cancel can return EINTR, deal with it. also, assume
io_submit also returns EINTR.
- fix some other minor bugs in linuxaio backend.
- ev_tstamp type can now be overriden by defining EV_TSTAMP_T.
- cleanup: replace expect_true/false and noinline by their
libecb counterparts.
- move syscall infrastructure from ev_linuxaio.c to ev.c.
- prepare io_uring integration.
- tweak ev_floor.
- epoll, poll, win32 Sleep and other places that use millisecond
reslution now all try to round up times.
- solaris port backend didn't compile.
- abstract time constants into their macros, for more flexibility.
4.27 Thu Jun 27 22:43:44 CEST 2019
- linux aio backend almost completely rewritten to work around its
limitations.
- linux aio backend now requires linux 4.19+.
- epoll backend now mandatory for linux aio backend.
- fail assertions more aggressively on invalid fd's detected
in the event loop, do not just silently fd_kill in case of
user error.
- ev_io_start/ev_io_stop now verify the watcher fd using
a syscall when EV_VERIFY is 2 or higher.
4.26 (EV only)
- update to libecb 0x00010006.
- new experimental linux aio backend (linux 4.18+).
- removed redundant 0-ptr check in ev_once.
- updated/extended ev_set_allocator documentation.
- replaced EMPTY2 macro by array_needsize_noinit.
- minor code cleanups.
- epoll backend now uses epoll_create1 also after fork.
4.25 Fri Dec 21 07:49:20 CET 2018 4.25 Fri Dec 21 07:49:20 CET 2018
- INCOMPATIBLE CHANGE: EV_THROW was renamed to EV_NOEXCEPT - INCOMPATIBLE CHANGE: EV_THROW was renamed to EV_NOEXCEPT
(EV_THROW sitll provided) and now uses noexcept on C++11 or newer. (EV_THROW still provided) and now uses noexcept on C++11 or newer.
- move the darwin select workaround highe rin ev.c, as newer versions of - move the darwin select workaround higher in ev.c, as newer versions of
darwin managed to break their broken select even more. darwin managed to break their broken select even more.
- ANDROID => __ANDROID__ (reported by enh@google.com). - ANDROID => __ANDROID__ (reported by enh@google.com).
- disable epoll_create1 on android because it has broken header files - disable epoll_create1 on android because it has broken header files
......
# Makefile.in generated by automake 1.15 from Makefile.am. # Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc. # Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
...@@ -157,7 +157,8 @@ am__v_at_0 = @ ...@@ -157,7 +157,8 @@ am__v_at_0 = @
am__v_at_1 = am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/ev.Plo ./$(DEPDIR)/event.Plo
am__mv = mv -f am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
...@@ -351,7 +352,8 @@ AUTOMAKE_OPTIONS = foreign ...@@ -351,7 +352,8 @@ AUTOMAKE_OPTIONS = foreign
VERSION_INFO = 4:0:0 VERSION_INFO = 4:0:0
EXTRA_DIST = LICENSE Changes libev.m4 autogen.sh \ EXTRA_DIST = LICENSE Changes libev.m4 autogen.sh \
ev_vars.h ev_wrap.h \ ev_vars.h ev_wrap.h \
ev_epoll.c ev_select.c ev_poll.c ev_kqueue.c ev_port.c ev_win32.c \ ev_epoll.c ev_select.c ev_poll.c ev_kqueue.c ev_port.c ev_linuxaio.c ev_iouring.c \
ev_win32.c \
ev.3 ev.pod Symbols.ev Symbols.event ev.3 ev.pod Symbols.ev Symbols.event
man_MANS = ev.3 man_MANS = ev.3
...@@ -385,8 +387,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ...@@ -385,8 +387,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' $(SHELL) ./config.status'; \ echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \ $(SHELL) ./config.status;; \
*) \ *) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac; esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
...@@ -457,8 +459,14 @@ mostlyclean-compile: ...@@ -457,8 +459,14 @@ mostlyclean-compile:
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ev.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o: .c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
...@@ -613,7 +621,10 @@ distclean-tags: ...@@ -613,7 +621,10 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES) distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
$(am__remove_distdir) $(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)" test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
...@@ -653,7 +664,7 @@ distdir: $(DISTFILES) ...@@ -653,7 +664,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)" || chmod -R a+r "$(distdir)"
dist-gzip: distdir dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-bzip2: distdir dist-bzip2: distdir
...@@ -679,7 +690,7 @@ dist-shar: distdir ...@@ -679,7 +690,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \ @echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2 "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-zip: distdir dist-zip: distdir
...@@ -697,7 +708,7 @@ dist dist-all: ...@@ -697,7 +708,7 @@ dist dist-all:
distcheck: dist distcheck: dist
case '$(DIST_ARCHIVES)' in \ case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \ *.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \ *.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \ *.tar.lz*) \
...@@ -707,7 +718,7 @@ distcheck: dist ...@@ -707,7 +718,7 @@ distcheck: dist
*.tar.Z*) \ *.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \ *.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
esac esac
...@@ -820,7 +831,8 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ ...@@ -820,7 +831,8 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
distclean: distclean-am distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR) -rm -f ./$(DEPDIR)/ev.Plo
-rm -f ./$(DEPDIR)/event.Plo
-rm -f Makefile -rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \ distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags distclean-hdr distclean-libtool distclean-tags
...@@ -868,7 +880,8 @@ installcheck-am: ...@@ -868,7 +880,8 @@ installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache -rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR) -rm -f ./$(DEPDIR)/ev.Plo
-rm -f ./$(DEPDIR)/event.Plo
-rm -f Makefile -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
...@@ -892,24 +905,24 @@ uninstall-man: uninstall-man3 ...@@ -892,24 +905,24 @@ uninstall-man: uninstall-man3
.MAKE: all install-am install-strip .MAKE: all install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \
clean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \ check-am clean clean-cscope clean-generic clean-libLTLIBRARIES \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
distcheck distclean distclean-compile distclean-generic \ dist-xz dist-zip distcheck distclean distclean-compile \
distclean-hdr distclean-libtool distclean-tags distcleancheck \ distclean-generic distclean-hdr distclean-libtool \
distdir distuninstallcheck dvi dvi-am html html-am info \ distclean-tags distcleancheck distdir distuninstallcheck dvi \
info-am install install-am install-data install-data-am \ dvi-am html html-am info info-am install install-am \
install-dvi install-dvi-am install-exec install-exec-am \ install-data install-data-am install-dvi install-dvi-am \
install-html install-html-am install-includeHEADERS \ install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-libLTLIBRARIES \ install-includeHEADERS install-info install-info-am \
install-man install-man3 install-pdf install-pdf-am install-ps \ install-libLTLIBRARIES install-man install-man3 install-pdf \
install-ps-am install-strip installcheck installcheck-am \ install-pdf-am install-ps install-ps-am install-strip \
installdirs maintainer-clean maintainer-clean-generic \ installcheck installcheck-am installdirs maintainer-clean \
mostlyclean mostlyclean-compile mostlyclean-generic \ maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall-am uninstall-includeHEADERS uninstall-libLTLIBRARIES \ tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
uninstall-man uninstall-man3 uninstall-libLTLIBRARIES uninstall-man uninstall-man3
.PRECIOUS: Makefile .PRECIOUS: Makefile
......
...@@ -18,7 +18,8 @@ ABOUT ...@@ -18,7 +18,8 @@ ABOUT
- extensive and detailed, readable documentation (not doxygen garbage). - extensive and detailed, readable documentation (not doxygen garbage).
- fully supports fork, can detect fork in various ways and automatically - fully supports fork, can detect fork in various ways and automatically
re-arms kernel mechanisms that do not support fork. re-arms kernel mechanisms that do not support fork.
- highly optimised select, poll, epoll, kqueue and event ports backends. - highly optimised select, poll, linux epoll, linux aio, bsd kqueue
and solaris event ports backends.
- filesystem object (path) watching (with optional linux inotify support). - filesystem object (path) watching (with optional linux inotify support).
- wallclock-based times (using absolute time, cron-like). - wallclock-based times (using absolute time, cron-like).
- relative timers/timeouts (handle time jumps). - relative timers/timeouts (handle time jumps).
......
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright 1992-2019 Free Software Foundation, Inc. # Copyright 1992-2020 Free Software Foundation, Inc.
timestamp='2019-03-04' timestamp='2020-01-01'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
...@@ -50,7 +50,7 @@ version="\ ...@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright 1992-2019 Free Software Foundation, Inc. Copyright 1992-2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
...@@ -99,6 +99,8 @@ tmp= ...@@ -99,6 +99,8 @@ tmp=
trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
set_cc_for_build() { set_cc_for_build() {
# prevent multiple calls if $tmp is already set
test "$tmp" && return 0
: "${TMPDIR=/tmp}" : "${TMPDIR=/tmp}"
# shellcheck disable=SC2039 # shellcheck disable=SC2039
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
...@@ -262,6 +264,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in ...@@ -262,6 +264,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:SolidBSD:*:*) *:SolidBSD:*:*)
echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
exit ;; exit ;;
*:OS108:*:*)
echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*) macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd"$UNAME_RELEASE" echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;; exit ;;
...@@ -271,6 +276,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in ...@@ -271,6 +276,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:Sortix:*:*) *:Sortix:*:*)
echo "$UNAME_MACHINE"-unknown-sortix echo "$UNAME_MACHINE"-unknown-sortix
exit ;; exit ;;
*:Twizzler:*:*)
echo "$UNAME_MACHINE"-unknown-twizzler
exit ;;
*:Redox:*:*) *:Redox:*:*)
echo "$UNAME_MACHINE"-unknown-redox echo "$UNAME_MACHINE"-unknown-redox
exit ;; exit ;;
...@@ -918,7 +926,7 @@ EOF ...@@ -918,7 +926,7 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;; exit ;;
alpha:Linux:*:*) alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;; EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;; EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;; PCA56) UNAME_MACHINE=alphapca56 ;;
...@@ -1325,12 +1333,19 @@ EOF ...@@ -1325,12 +1333,19 @@ EOF
echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;; exit ;;
*:Darwin:*:*) *:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
if command -v xcode-select > /dev/null 2> /dev/null && \
! xcode-select --print-path > /dev/null 2> /dev/null ; then
# Avoid executing cc if there is no toolchain installed as
# cc will be a stub that puts up a graphical alert
# prompting the user to install developer tools.
CC_FOR_BUILD=no_compiler_found
else
set_cc_for_build set_cc_for_build
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi fi
if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
...@@ -1348,15 +1363,9 @@ EOF ...@@ -1348,15 +1363,9 @@ EOF
then then
UNAME_PROCESSOR=powerpc UNAME_PROCESSOR=powerpc
fi fi
fi
elif test "$UNAME_PROCESSOR" = i386 ; then elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub # uname -m returns i386 or x86_64
# that puts up a graphical alert prompting to install UNAME_PROCESSOR=$UNAME_MACHINE
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
fi fi
echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;; exit ;;
...@@ -1468,6 +1477,14 @@ cat > "$dummy.c" <<EOF ...@@ -1468,6 +1477,14 @@ cat > "$dummy.c" <<EOF
#include <sys/types.h> #include <sys/types.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#endif #endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#include <signal.h>
#if defined(_SIZE_T_) || defined(SIGLOST)
#include <sys/utsname.h>
#endif
#endif
#endif
main () main ()
{ {
#if defined (sony) #if defined (sony)
...@@ -1554,19 +1571,24 @@ main () ...@@ -1554,19 +1571,24 @@ main ()
#else #else
printf ("vax-dec-bsd\n"); exit (0); printf ("vax-dec-bsd\n"); exit (0);
#endif #endif
#else
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname un;
uname (&un);
printf ("vax-dec-ultrix%s\n", un.release); exit (0);
#else #else
printf ("vax-dec-ultrix\n"); exit (0); printf ("vax-dec-ultrix\n"); exit (0);
#endif #endif
#endif #endif
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#include <signal.h> #if defined(_SIZE_T_) || defined(SIGLOST)
#if defined(_SIZE_T_) /* >= ULTRIX4 */ struct utsname *un;
printf ("mips-dec-ultrix4\n"); exit (0); uname (&un);
printf ("mips-dec-ultrix%s\n", un.release); exit (0);
#else #else
#if defined(ULTRIX3) || defined(ultrix3) || defined(SIGLOST) printf ("mips-dec-ultrix\n"); exit (0);
printf ("mips-dec-ultrix3\n"); exit (0);
#endif
#endif #endif
#endif #endif
#endif #endif
......
...@@ -24,12 +24,21 @@ ...@@ -24,12 +24,21 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
/* Define to 1 if linux/fs.h defined kernel_rwf_t */
#undef HAVE_KERNEL_RWF_T
/* Define to 1 if you have the `kqueue' function. */ /* Define to 1 if you have the `kqueue' function. */
#undef HAVE_KQUEUE #undef HAVE_KQUEUE
/* Define to 1 if you have the `rt' library (-lrt). */ /* Define to 1 if you have the `rt' library (-lrt). */
#undef HAVE_LIBRT #undef HAVE_LIBRT
/* Define to 1 if you have the <linux/aio_abi.h> header file. */
#undef HAVE_LINUX_AIO_ABI_H
/* Define to 1 if you have the <linux/fs.h> header file. */
#undef HAVE_LINUX_FS_H
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H #undef HAVE_MEMORY_H
...@@ -87,6 +96,9 @@ ...@@ -87,6 +96,9 @@
/* Define to 1 if you have the <sys/stat.h> header file. */ /* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H #undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/timerfd.h> header file. */
#undef HAVE_SYS_TIMERFD_H
/* Define to 1 if you have the <sys/types.h> header file. */ /* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H #undef HAVE_SYS_TYPES_H
......
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright 1992-2019 Free Software Foundation, Inc. # Copyright 1992-2020 Free Software Foundation, Inc.
timestamp='2019-01-05' timestamp='2020-01-01'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
...@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>." ...@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright 1992-2019 Free Software Foundation, Inc. Copyright 1992-2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
...@@ -337,17 +337,14 @@ case $1 in ...@@ -337,17 +337,14 @@ case $1 in
basic_machine=m88k-harris basic_machine=m88k-harris
os=sysv3 os=sysv3
;; ;;
hp300) hp300 | hp300hpux)
basic_machine=m68k-hp basic_machine=m68k-hp
os=hpux
;; ;;
hp300bsd) hp300bsd)
basic_machine=m68k-hp basic_machine=m68k-hp
os=bsd os=bsd
;; ;;
hp300hpux)
basic_machine=m68k-hp
os=hpux
;;
hppaosf) hppaosf)
basic_machine=hppa1.1-hp basic_machine=hppa1.1-hp
os=osf os=osf
...@@ -360,10 +357,6 @@ case $1 in ...@@ -360,10 +357,6 @@ case $1 in
basic_machine=i386-mach basic_machine=i386-mach
os=mach os=mach
;; ;;
vsta)
basic_machine=i386-pc
os=vsta
;;
isi68 | isi) isi68 | isi)
basic_machine=m68k-isi basic_machine=m68k-isi
os=sysv os=sysv
...@@ -612,6 +605,10 @@ case $1 in ...@@ -612,6 +605,10 @@ case $1 in
basic_machine=vax-dec basic_machine=vax-dec
os=vms os=vms
;; ;;
vsta)
basic_machine=i386-pc
os=vsta
;;
vxworks960) vxworks960)
basic_machine=i960-wrs basic_machine=i960-wrs
os=vxworks os=vxworks
...@@ -1172,7 +1169,7 @@ case $cpu-$vendor in ...@@ -1172,7 +1169,7 @@ case $cpu-$vendor in
| asmjs \ | asmjs \
| ba \ | ba \
| be32 | be64 \ | be32 | be64 \
| bfin | bs2000 \ | bfin | bpf | bs2000 \
| c[123]* | c30 | [cjt]90 | c4x \ | c[123]* | c30 | [cjt]90 | c4x \
| c8051 | clipper | craynv | csky | cydra \ | c8051 | clipper | craynv | csky | cydra \
| d10v | d30v | dlx | dsp16xx \ | d10v | d30v | dlx | dsp16xx \
...@@ -1346,11 +1343,11 @@ case $os in ...@@ -1346,11 +1343,11 @@ case $os in
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
| sym* | kopensolaris* | plan9* \ | sym* | kopensolaris* | plan9* \
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
| aos* | aros* | cloudabi* | sortix* \ | aos* | aros* | cloudabi* | sortix* | twizzler* \
| nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
| clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
| knetbsd* | mirbsd* | netbsd* \ | knetbsd* | mirbsd* | netbsd* \
| bitrig* | openbsd* | solidbsd* | libertybsd* \ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
| ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
| bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
| ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
...@@ -1368,7 +1365,8 @@ case $os in ...@@ -1368,7 +1365,8 @@ case $os in
| powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
| skyos* | haiku* | rdos* | toppers* | drops* | es* \ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi*) | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
| nsk* | powerunix)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
qnx*) qnx*)
...@@ -1452,9 +1450,6 @@ case $os in ...@@ -1452,9 +1450,6 @@ case $os in
ns2) ns2)
os=nextstep2 os=nextstep2
;; ;;
nsk*)
os=nsk
;;
# Preserve the version number of sinix5. # Preserve the version number of sinix5.
sinix5.*) sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'` os=`echo $os | sed -e 's|sinix|sysv|'`
......
This diff is collapsed.
#! /bin/sh #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects # depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Copyright (C) 1999-2018 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC ...@@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC
# GNU General Public License for more details. # GNU General Public License for more details.
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
...@@ -783,9 +783,9 @@ exit 0 ...@@ -783,9 +783,9 @@ exit 0
# Local Variables: # Local Variables:
# mode: shell-script # mode: shell-script
# sh-indentation: 2 # sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC" # time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC" # time-stamp-end: "; # UTC"
# End: # End:
This diff is collapsed.
This diff is collapsed.
/* /*
* libev native API header * libev native API header
* *
* Copyright (c) 2007-2018 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007-2019 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-
...@@ -151,7 +151,10 @@ EV_CPP(extern "C" {) ...@@ -151,7 +151,10 @@ EV_CPP(extern "C" {)
/*****************************************************************************/ /*****************************************************************************/
typedef double ev_tstamp; #ifndef EV_TSTAMP_T
# define EV_TSTAMP_T double
#endif
typedef EV_TSTAMP_T ev_tstamp;
#include <string.h> /* for memmove */ #include <string.h> /* for memmove */
...@@ -212,7 +215,7 @@ struct ev_loop; ...@@ -212,7 +215,7 @@ struct ev_loop;
/*****************************************************************************/ /*****************************************************************************/
#define EV_VERSION_MAJOR 4 #define EV_VERSION_MAJOR 4
#define EV_VERSION_MINOR 25 #define EV_VERSION_MINOR 31
/* eventmask, revents, events... */ /* eventmask, revents, events... */
enum { enum {
...@@ -511,7 +514,8 @@ enum { ...@@ -511,7 +514,8 @@ enum {
EVFLAG_NOSIGFD = 0, /* compatibility to pre-3.9 */ EVFLAG_NOSIGFD = 0, /* compatibility to pre-3.9 */
#endif #endif
EVFLAG_SIGNALFD = 0x00200000U, /* attempt to use signalfd */ EVFLAG_SIGNALFD = 0x00200000U, /* attempt to use signalfd */
EVFLAG_NOSIGMASK = 0x00400000U /* avoid modifying the signal mask */ EVFLAG_NOSIGMASK = 0x00400000U, /* avoid modifying the signal mask */
EVFLAG_NOTIMERFD = 0x00800000U /* avoid creating a timerfd */
}; };
/* method bits to be ored together */ /* method bits to be ored together */
...@@ -522,7 +526,9 @@ enum { ...@@ -522,7 +526,9 @@ enum {
EVBACKEND_KQUEUE = 0x00000008U, /* bsd, broken on osx */ EVBACKEND_KQUEUE = 0x00000008U, /* bsd, broken on osx */
EVBACKEND_DEVPOLL = 0x00000010U, /* solaris 8 */ /* NYI */ EVBACKEND_DEVPOLL = 0x00000010U, /* solaris 8 */ /* NYI */
EVBACKEND_PORT = 0x00000020U, /* solaris 10 */ EVBACKEND_PORT = 0x00000020U, /* solaris 10 */
EVBACKEND_ALL = 0x0000003FU, /* all known backends */ EVBACKEND_LINUXAIO = 0x00000040U, /* linuix AIO, 4.19+ */
EVBACKEND_IOURING = 0x00000080U, /* linux io_uring, 5.1+ */
EVBACKEND_ALL = 0x000000FFU, /* all known backends */
EVBACKEND_MASK = 0x0000FFFFU /* all future backends */ EVBACKEND_MASK = 0x0000FFFFU /* all future backends */
}; };
......
This diff is collapsed.
/* /*
* libev epoll fd activity backend * libev epoll fd activity backend
* *
* Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007,2008,2009,2010,2011,2016,2017,2019 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-
...@@ -93,10 +93,10 @@ epoll_modify (EV_P_ int fd, int oev, int nev) ...@@ -93,10 +93,10 @@ epoll_modify (EV_P_ int fd, int oev, int nev)
ev.events = (nev & EV_READ ? EPOLLIN : 0) ev.events = (nev & EV_READ ? EPOLLIN : 0)
| (nev & EV_WRITE ? EPOLLOUT : 0); | (nev & EV_WRITE ? EPOLLOUT : 0);
if (expect_true (!epoll_ctl (backend_fd, oev && oldmask != nev ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, fd, &ev))) if (ecb_expect_true (!epoll_ctl (backend_fd, oev && oldmask != nev ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, fd, &ev)))
return; return;
if (expect_true (errno == ENOENT)) if (ecb_expect_true (errno == ENOENT))
{ {
/* if ENOENT then the fd went away, so try to do the right thing */ /* if ENOENT then the fd went away, so try to do the right thing */
if (!nev) if (!nev)
...@@ -105,7 +105,7 @@ epoll_modify (EV_P_ int fd, int oev, int nev) ...@@ -105,7 +105,7 @@ epoll_modify (EV_P_ int fd, int oev, int nev)
if (!epoll_ctl (backend_fd, EPOLL_CTL_ADD, fd, &ev)) if (!epoll_ctl (backend_fd, EPOLL_CTL_ADD, fd, &ev))
return; return;
} }
else if (expect_true (errno == EEXIST)) else if (ecb_expect_true (errno == EEXIST))
{ {
/* EEXIST means we ignored a previous DEL, but the fd is still active */ /* EEXIST means we ignored a previous DEL, but the fd is still active */
/* if the kernel mask is the same as the new mask, we assume it hasn't changed */ /* if the kernel mask is the same as the new mask, we assume it hasn't changed */
...@@ -115,7 +115,7 @@ epoll_modify (EV_P_ int fd, int oev, int nev) ...@@ -115,7 +115,7 @@ epoll_modify (EV_P_ int fd, int oev, int nev)
if (!epoll_ctl (backend_fd, EPOLL_CTL_MOD, fd, &ev)) if (!epoll_ctl (backend_fd, EPOLL_CTL_MOD, fd, &ev))
return; return;
} }
else if (expect_true (errno == EPERM)) else if (ecb_expect_true (errno == EPERM))
{ {
/* EPERM means the fd is always ready, but epoll is too snobbish */ /* EPERM means the fd is always ready, but epoll is too snobbish */
/* to handle it, unlike select or poll. */ /* to handle it, unlike select or poll. */
...@@ -124,12 +124,14 @@ epoll_modify (EV_P_ int fd, int oev, int nev) ...@@ -124,12 +124,14 @@ epoll_modify (EV_P_ int fd, int oev, int nev)
/* add fd to epoll_eperms, if not already inside */ /* add fd to epoll_eperms, if not already inside */
if (!(oldmask & EV_EMASK_EPERM)) if (!(oldmask & EV_EMASK_EPERM))
{ {
array_needsize (int, epoll_eperms, epoll_epermmax, epoll_epermcnt + 1, EMPTY2); array_needsize (int, epoll_eperms, epoll_epermmax, epoll_epermcnt + 1, array_needsize_noinit);
epoll_eperms [epoll_epermcnt++] = fd; epoll_eperms [epoll_epermcnt++] = fd;
} }
return; return;
} }
else
assert (("libev: I/O watcher with invalid fd found in epoll_ctl", errno != EBADF && errno != ELOOP && errno != EINVAL));
fd_kill (EV_A_ fd); fd_kill (EV_A_ fd);
...@@ -144,16 +146,16 @@ epoll_poll (EV_P_ ev_tstamp timeout) ...@@ -144,16 +146,16 @@ epoll_poll (EV_P_ ev_tstamp timeout)
int i; int i;
int eventcnt; int eventcnt;
if (expect_false (epoll_epermcnt)) if (ecb_expect_false (epoll_epermcnt))
timeout = 0.; timeout = EV_TS_CONST (0.);
/* epoll wait times cannot be larger than (LONG_MAX - 999UL) / HZ msecs, which is below */ /* epoll wait times cannot be larger than (LONG_MAX - 999UL) / HZ msecs, which is below */
/* the default libev max wait time, however. */ /* the default libev max wait time, however. */
EV_RELEASE_CB; EV_RELEASE_CB;
eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, timeout * 1e3); eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, EV_TS_TO_MSEC (timeout));
EV_ACQUIRE_CB; EV_ACQUIRE_CB;
if (expect_false (eventcnt < 0)) if (ecb_expect_false (eventcnt < 0))
{ {
if (errno != EINTR) if (errno != EINTR)
ev_syserr ("(libev) epoll_wait"); ev_syserr ("(libev) epoll_wait");
...@@ -176,14 +178,14 @@ epoll_poll (EV_P_ ev_tstamp timeout) ...@@ -176,14 +178,14 @@ epoll_poll (EV_P_ ev_tstamp timeout)
* other spurious notifications will be found by epoll_ctl, below * other spurious notifications will be found by epoll_ctl, below
* we assume that fd is always in range, as we never shrink the anfds array * we assume that fd is always in range, as we never shrink the anfds array
*/ */
if (expect_false ((uint32_t)anfds [fd].egen != (uint32_t)(ev->data.u64 >> 32))) if (ecb_expect_false ((uint32_t)anfds [fd].egen != (uint32_t)(ev->data.u64 >> 32)))
{ {
/* recreate kernel state */ /* recreate kernel state */
postfork |= 2; postfork |= 2;
continue; continue;
} }
if (expect_false (got & ~want)) if (ecb_expect_false (got & ~want))
{ {
anfds [fd].emask = want; anfds [fd].emask = want;
...@@ -195,6 +197,8 @@ epoll_poll (EV_P_ ev_tstamp timeout) ...@@ -195,6 +197,8 @@ epoll_poll (EV_P_ ev_tstamp timeout)
* above with the gencounter check (== our fd is not the event fd), and * above with the gencounter check (== our fd is not the event fd), and
* partially here, when epoll_ctl returns an error (== a child has the fd * partially here, when epoll_ctl returns an error (== a child has the fd
* but we closed it). * but we closed it).
* note: for events such as POLLHUP, where we can't know whether it refers
* to EV_READ or EV_WRITE, we might issue redundant EPOLL_CTL_MOD calls.
*/ */
ev->events = (want & EV_READ ? EPOLLIN : 0) ev->events = (want & EV_READ ? EPOLLIN : 0)
| (want & EV_WRITE ? EPOLLOUT : 0); | (want & EV_WRITE ? EPOLLOUT : 0);
...@@ -212,7 +216,7 @@ epoll_poll (EV_P_ ev_tstamp timeout) ...@@ -212,7 +216,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
} }
/* if the receive array was full, increase its size */ /* if the receive array was full, increase its size */
if (expect_false (eventcnt == epoll_eventmax)) if (ecb_expect_false (eventcnt == epoll_eventmax))
{ {
ev_free (epoll_events); ev_free (epoll_events);
epoll_eventmax = array_nextsize (sizeof (struct epoll_event), epoll_eventmax, epoll_eventmax + 1); epoll_eventmax = array_nextsize (sizeof (struct epoll_event), epoll_eventmax, epoll_eventmax + 1);
...@@ -235,23 +239,34 @@ epoll_poll (EV_P_ ev_tstamp timeout) ...@@ -235,23 +239,34 @@ epoll_poll (EV_P_ ev_tstamp timeout)
} }
} }
inline_size static int
int epoll_epoll_create (void)
epoll_init (EV_P_ int flags)
{ {
int fd;
#if defined EPOLL_CLOEXEC && !defined __ANDROID__ #if defined EPOLL_CLOEXEC && !defined __ANDROID__
backend_fd = epoll_create1 (EPOLL_CLOEXEC); fd = epoll_create1 (EPOLL_CLOEXEC);
if (backend_fd < 0 && (errno == EINVAL || errno == ENOSYS)) if (fd < 0 && (errno == EINVAL || errno == ENOSYS))
#endif #endif
backend_fd = epoll_create (256); {
fd = epoll_create (256);
if (backend_fd < 0) if (fd >= 0)
return 0; fcntl (fd, F_SETFD, FD_CLOEXEC);
}
fcntl (backend_fd, F_SETFD, FD_CLOEXEC); return fd;
}
backend_mintime = 1e-3; /* epoll does sometimes return early, this is just to avoid the worst */ inline_size
int
epoll_init (EV_P_ int flags)
{
if ((backend_fd = epoll_epoll_create ()) < 0)
return 0;
backend_mintime = EV_TS_CONST (1e-3); /* epoll does sometimes return early, this is just to avoid the worst */
backend_modify = epoll_modify; backend_modify = epoll_modify;
backend_poll = epoll_poll; backend_poll = epoll_poll;
...@@ -269,17 +284,15 @@ epoll_destroy (EV_P) ...@@ -269,17 +284,15 @@ epoll_destroy (EV_P)
array_free (epoll_eperm, EMPTY); array_free (epoll_eperm, EMPTY);
} }
inline_size ecb_cold
void static void
epoll_fork (EV_P) epoll_fork (EV_P)
{ {
close (backend_fd); close (backend_fd);
while ((backend_fd = epoll_create (256)) < 0) while ((backend_fd = epoll_epoll_create ()) < 0)
ev_syserr ("(libev) epoll_create"); ev_syserr ("(libev) epoll_create");
fcntl (backend_fd, F_SETFD, FD_CLOEXEC);
fd_rearm_all (EV_A); fd_rearm_all (EV_A);
} }
This diff is collapsed.
/* /*
* libev kqueue backend * libev kqueue backend
* *
* Copyright (c) 2007,2008,2009,2010,2011,2012,2013 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2016,2019 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-
...@@ -48,7 +48,7 @@ void ...@@ -48,7 +48,7 @@ void
kqueue_change (EV_P_ int fd, int filter, int flags, int fflags) kqueue_change (EV_P_ int fd, int filter, int flags, int fflags)
{ {
++kqueue_changecnt; ++kqueue_changecnt;
array_needsize (struct kevent, kqueue_changes, kqueue_changemax, kqueue_changecnt, EMPTY2); array_needsize (struct kevent, kqueue_changes, kqueue_changemax, kqueue_changecnt, array_needsize_noinit);
EV_SET (&kqueue_changes [kqueue_changecnt - 1], fd, filter, flags, fflags, 0, 0); EV_SET (&kqueue_changes [kqueue_changecnt - 1], fd, filter, flags, fflags, 0, 0);
} }
...@@ -103,10 +103,10 @@ kqueue_poll (EV_P_ ev_tstamp timeout) ...@@ -103,10 +103,10 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
EV_ACQUIRE_CB; EV_ACQUIRE_CB;
kqueue_changecnt = 0; kqueue_changecnt = 0;
if (expect_false (res < 0)) if (ecb_expect_false (res < 0))
{ {
if (errno != EINTR) if (errno != EINTR)
ev_syserr ("(libev) kevent"); ev_syserr ("(libev) kqueue kevent");
return; return;
} }
...@@ -115,7 +115,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout) ...@@ -115,7 +115,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
{ {
int fd = kqueue_events [i].ident; int fd = kqueue_events [i].ident;
if (expect_false (kqueue_events [i].flags & EV_ERROR)) if (ecb_expect_false (kqueue_events [i].flags & EV_ERROR))
{ {
int err = kqueue_events [i].data; int err = kqueue_events [i].data;
...@@ -129,12 +129,18 @@ kqueue_poll (EV_P_ ev_tstamp timeout) ...@@ -129,12 +129,18 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
if (fd_valid (fd)) if (fd_valid (fd))
kqueue_modify (EV_A_ fd, 0, anfds [fd].events); kqueue_modify (EV_A_ fd, 0, anfds [fd].events);
else else
{
assert (("libev: kqueue found invalid fd", 0));
fd_kill (EV_A_ fd); fd_kill (EV_A_ fd);
} }
}
else /* on all other errors, we error out on the fd */ else /* on all other errors, we error out on the fd */
{
assert (("libev: kqueue found invalid fd", 0));
fd_kill (EV_A_ fd); fd_kill (EV_A_ fd);
} }
} }
}
else else
fd_event ( fd_event (
EV_A_ EV_A_
...@@ -145,7 +151,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout) ...@@ -145,7 +151,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
); );
} }
if (expect_false (res == kqueue_eventmax)) if (ecb_expect_false (res == kqueue_eventmax))
{ {
ev_free (kqueue_events); ev_free (kqueue_events);
kqueue_eventmax = array_nextsize (sizeof (struct kevent), kqueue_eventmax, kqueue_eventmax + 1); kqueue_eventmax = array_nextsize (sizeof (struct kevent), kqueue_eventmax, kqueue_eventmax + 1);
...@@ -164,7 +170,7 @@ kqueue_init (EV_P_ int flags) ...@@ -164,7 +170,7 @@ kqueue_init (EV_P_ int flags)
fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */ fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */
backend_mintime = 1e-9; /* apparently, they did the right thing in freebsd */ backend_mintime = EV_TS_CONST (1e-9); /* apparently, they did the right thing in freebsd */
backend_modify = kqueue_modify; backend_modify = kqueue_modify;
backend_poll = kqueue_poll; backend_poll = kqueue_poll;
......
This diff is collapsed.
This diff is collapsed.
/* /*
* libev solaris event port backend * libev solaris event port backend
* *
* Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007,2008,2009,2010,2011,2019 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-
...@@ -69,7 +69,10 @@ port_associate_and_check (EV_P_ int fd, int ev) ...@@ -69,7 +69,10 @@ port_associate_and_check (EV_P_ int fd, int ev)
) )
{ {
if (errno == EBADFD) if (errno == EBADFD)
{
assert (("libev: port_associate found invalid fd", errno != EBADFD));
fd_kill (EV_A_ fd); fd_kill (EV_A_ fd);
}
else else
ev_syserr ("(libev) port_associate"); ev_syserr ("(libev) port_associate");
} }
...@@ -129,7 +132,7 @@ port_poll (EV_P_ ev_tstamp timeout) ...@@ -129,7 +132,7 @@ port_poll (EV_P_ ev_tstamp timeout)
} }
} }
if (expect_false (nget == port_eventmax)) if (ecb_expect_false (nget == port_eventmax))
{ {
ev_free (port_events); ev_free (port_events);
port_eventmax = array_nextsize (sizeof (port_event_t), port_eventmax, port_eventmax + 1); port_eventmax = array_nextsize (sizeof (port_event_t), port_eventmax, port_eventmax + 1);
...@@ -151,11 +154,11 @@ port_init (EV_P_ int flags) ...@@ -151,11 +154,11 @@ port_init (EV_P_ int flags)
/* if my reading of the opensolaris kernel sources are correct, then /* if my reading of the opensolaris kernel sources are correct, then
* opensolaris does something very stupid: it checks if the time has already * opensolaris does something very stupid: it checks if the time has already
* elapsed and doesn't round up if that is the case,m otherwise it DOES round * elapsed and doesn't round up if that is the case, otherwise it DOES round
* up. Since we can't know what the case is, we need to guess by using a * up. Since we can't know what the case is, we need to guess by using a
* "large enough" timeout. Normally, 1e-9 would be correct. * "large enough" timeout. Normally, 1e-9 would be correct.
*/ */
backend_mintime = 1e-3; /* needed to compensate for port_getn returning early */ backend_mintime = EV_TS_CONST (1e-3); /* needed to compensate for port_getn returning early */
backend_modify = port_modify; backend_modify = port_modify;
backend_poll = port_poll; backend_poll = port_poll;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment