Unreleased ------------------------------------------------------------------------ 2022-04-27 v2.6.2 ------------------------------------------------------------------------ * Fix: Various build system and include fixes to allow libkqueue to build correctly with musl libc. * Fix: Various macro and include fixes for Windows/MinGW builds. (Fixed by: neheb) * Always build both a static and a shared library. The STATIC_KQUEUE build variable has been removed. 2022-04-27 v2.6.1 ------------------------------------------------------------------------ * Fix: Set the core dumped flag correctly in linux/proc on CLD_DUMPED. * Fix: Don't attempt to cleanup memory on fork as free() is not fork safe. We still close open kqueue FDs on fork, and liberal use of CLOEXEC should clean up any lingering filter FDs though we may want to close these explicitly in future too. * Fix: Double unlock in posix/proc.c * Fix: Potential deadlock on kqueue initialisation failure. * Fix: Building for MSVC (Patch by Jan200101) * Fix: Sprinkle CLOEXEC around various places in the Linux and POSIX platforms to stop us leaking file descriptors on exec. * Add EVFILT_LIBKQUEUE/NOTE_THREAD_SAFE. When set to 0, the global mutex is not locked on kqueue lookup. The application must guarantee that kqueues must not be destroyed by a different thread to the one that created them. 2022-03-21 v2.6.0 ------------------------------------------------------------------------ * Fix: posix/proc don't allow users of this filter to progress until the proc waiter thread has completed initialisation. * Fix: Address multiple thread synchronisation issues by using a single global mutex to synchronise the kqueue list and kqueue file descriptor map, and per kqueue mutexes which are locked for the duration of copyin and copyout. The per filter knote mutex was removed with this change as it's no longer needed. * Fix: posix/proc fix knote use after free if a notification comes in for a knote which has already been freed. The underlying issue was a problem with the list macros not zeroing out prev/next pointers when items were removed from lists. * Fix: prevent thread cancellation on Linux in kqueue() and kevent(). This prevents deadlocks occuring if a kqueue is shared between threads and one thread is cancelled. * Fix: linux Cleanup all kqueues by closing their file descriptors and freeing associated memory on fork. A similar fix needed for Solaris. * Fix: linux/read linux/write Prevent invalid access of fds->fds_write if the file descriptor state is freed after processing read events. * Fix: linux/monitor Use an atexit handler to ensure the fd monitoring thread is shutdown gracefully on Linux. This fixes spurious leak reports from LSAN et al... * Fix: linux/timer Allow EVFILT_TIMER filters to be modified on Linux (Closes #116) (Reported by: Grant Erickson). * Fix: Set the library search path in libkqueue.pc (Closes #117) (Reported by: Grant Erickson) * Fix: posix/proc will now no longer deadlock if the PID being monitored is reaped outside of libkqueue, or has exited before we start monitoring. * Fix: posix/proc all waiters will now be informed if monitoring a PID fails, i.e. if the PID is reaped outside of libkqueue. * Fix: Compilation on Windows (Closes #111). (Reported by: brechtsanders) * Fix: linux/read linux/write EPOLLERR, EPOLLHUP and EPOLLRDHUP on sockets would not produce a kevent and no EOF indication would be provided to the caller. * Fix: linux/signal pending signals of the type specified in a new signal event were reset when that event was added to a kqueue. * Fix: Multiple instances of posix/proc wait thread may have been spawned on repeated kqueue creation/destruction. This may have lead to missed process exit notifications. * Fix: Potential race between posix/proc waiter thread starting and events being added. * Fix: Deadlock between posix/proc waiter thread and kqueues. * Fix: udata should not be modified if the knote modification fails. * Test suites now pass on macOS 11.5.2 and FreeBSD 13. * Packaging: We now set the release number if the current checked out commit does not match a release tag. For example if the current number of commits between the last release tag and HEAD is 2, then the release will be `-3`. This allows easy upgrading of packages between releases. * Add EVFILT_LIBKQUEUE to expose libkqueue specific configuration options. The initial implementation supports NOTE_VERSION to retrieve the current version number, and NOTE_VERSION_STR to retrieve a textual description of the version. 2021-09-06 v2.5.0 ------------------------------------------------------------------------ * Add back support for monitoring process exit with EVFILT_PROC. The is done with `pidfd_open(2)` for Linux >= 5.3, and via a new common POSIX monitoring thread for Linux < 5.3 and other POSIX platforms. * Fix: Include errors (EV_ERROR), and changelist entries with EV_RECEIPT in eventlist. (Reported by: orbitz) 2021-08-14 v2.4.0 ------------------------------------------------------------------------ * Fix: avoid segfaults when kqueue descriptors are cleaned up. * Fix: Prevent potential dead-lock in linux_kqueue_init() * Fix: slight deadlock in thread_start() * Fix: missing inotify_rm_watch() * Fix: call close() in an error handling path * Fix: take the write lock when freeing knotes * Keep a separate state tree for file descriptors inserted into epoll to avoid conflicts between EVFILT_READ and EVFILT_WRITE (Closes #29 Closes #59) * Fix: deadlock and memory leak in kqueue() * Fix: use after free issue in decrementing kq reference counts * Default to marking file descriptors as passive sockets if fstat() doesn't hint at the type (Closes #97) * Fix various leaks and issues found by LSAN * Install event.h in $INCLUDEDIR/kqueue/sys, rather than $INCLUDEDIR/sys * Add support for building native Debian packages using Docker * Detect raw sockets. * Use high-resolution wait on Linux for timeouts finer than a millisecond. * Various CMake improvements. 2019-02-06 v2.3.1 ------------------------------------------------------------------------ * Support more knote flags (Credit: Dmitry Selyutin, PR #49) * Debian packaging updates (Credit: Matthew Newton) 2018-11-25 v2.3.0 ------------------------------------------------------------------------ * kevent: refactor to remove goto statement (Credit: Cameron Nemo) * Multiple fixes for compilation issues with GCC 8.1 (Credit: Arran Cudbard-Bell) * Add a monitoring thread that takes care of cleaning up closed kqueues (Credit: Philippe Wooding) * Multiple bug fixes for leaking descriptors in kn_delete() (Credit: Philippe Wooding) * Fix build errors on Linux systems that do not use glibc (Credit: maxice8) 2017-11-26 v2.2.0 ------------------------------------------------------------------------ * Fixed: the EOF flag should only be set on stream sockets with a zero length r ead Author: Arran Cudbard-Bell * Fix to deal with inotify events containing filenames correctly. Author: Arran Cudbard-Bell * Fix to allow libpcap FDs to be used. Author: Philippe Wooding * Switch to CMake as the build and packaging system. 2016-07-24 v2.1.0 ------------------------------------------------------------------------ * Fix an endianness issue when calling ioctl on Linux. (Credit: Vivian Kong) * Allow tests to be built from separate build directory. (Credit: Chris Bailey) * Add support for kevent64(2) timers from Darwin. (Credit: Hubertus Franke) * Set EPOLLONESHOT for EPOLL_CTL_ADD after knote creation. (Credit: Ian Partridge) * Add configure arg to disable install and build noinst ltlibrary. (Credit: Ian Partridge) * Allow libkqueue to be used as a submodule within another build process. (Credit: Ian Partridge) * Fix a build failure on Linux/AArch64 using Ubuntu 16.04. (Credit: Galen Rhodes) 2016-02-06 v2.0.4 ------------------------------------------------------------------------ * Fix incorrect boolean logic in src/linux/read.c (Credit: marcos69, closes #5) * Fix a build failure on mips64el. (Credit: YunQiang Su, from Debian Bug #754376) 2014-03-09 v2.0.3 ------------------------------------------------------------------------ * Fix the generation of libkqueue.pc 2014-02-23 v2.0.2 ------------------------------------------------------------------------ * Switch from SVN to Git * Switch hosting providers to Github * Switch to autoconf/automake 2013-05-08 v2.0.1 r646 ------------------------------------------------------------------------ * Improvements to the RPM package spec (Credit: Eric Wong) 2013-04-29 v2.0 r639 ------------------------------------------------------------------------ * Use ppoll(2) where possible to improve scalability. (Credit: Eric Wong) * Optimize kevent() when it is called with a zero timeout. (Credit: Eric Wong) * Avoid calling getsockopt() on file descriptors that are not sockets. (Credit: Eric Wong) * Call epoll_wait after linux_kevent_wait_hires() (Credit: Eric Wong) * Detect regular files correctly (Credit: Eric Wong) * Ensure that calling close() on a file descriptor will remove any kevents that reference the descriptor. [merged from ^/branches/stable@551] * Remove the SERIALIZE_KEVENT macro, and always protect kevent_copyin() and kevent_copyout() with a mutex. * Remove fine-grained locking at the knote level. * Add a counter that increments on each each kevent() call. When printing debug information within kevent(), display the value of the counter. This will be helpful when debugging a multithreaded program that may have multiple kevent() calls executing in parallel. (Credit: Julien Blache) 2010-09-18 v1.0 r344 ------------------------------------------------------------------------ * Support older Linux kernels that do not have the EPOLLRDHUP flag. * Add a portable implementation of the EVFILT_TIMER filter. * Add Solaris to the list of supported platforms. * Fixed the 'make rpm' target to work on CentOS 5. * Modified the manpage to remove unimplemented features. 2010-08-05 v0.9.3 r309 ------------------------------------------------------------------------ * Fix a typo in kevent_copyin() that caused EV_RECEIPT to set the data field incorrectly in some cases. (Credit to Julien Blache for discovering and fixing this bug) 2010-08-05 v0.9.2 r289 ------------------------------------------------------------------------ * Fix some build failures on 32-bit platforms related to the debugging codepaths being enabled by default. 2010-08-04 v0.9.1 r286 ------------------------------------------------------------------------ * Prevent dumping of EVFILT_VNODE debugging information to STDOUT. * Fix the 'make clean' target in the testsuite. 2010-08-01 v0.9 r285 ------------------------------------------------------------------------ * Set kevent.data = 1 for passive sockets that have at least one pending connection. (Credit to Julien Blache for finding and researching this bug) * Fix various compilation errors under Solaris. (Credit to Joakim Johansson for testing and providing patches) * Use the KQUEUE_DEBUG environment variable to turn on debugging output. 2010-07-21 v0.8 r264 ------------------------------------------------------------------------ * Fix a bug that prevented a knote with the EV_DISPATCH flag from being re-enabled after an event had been triggered. (Credit to Julien Blache for finding and researching this bug) 2010-06-08 v0.7 r248 ------------------------------------------------------------------------ * Add Debian packaging to the ports/ directory and improve the 'make deb' target. * Set the library soname version. * Switch from -fPIC to -fpic as the default in CFLAGS. 2010-03-28 v0.6 r238 ------------------------------------------------------------------------ * Experimental Linux kernel module. * Implement knote modification for signals. * Implement POSIX signal.c 2010-02-09 v0.5 r200 ------------------------------------------------------------------------ * Prevent namespace pollution by hiding all ELF symbols except for kqueue() and kevent(). * Add reference counting to the garbage collection mechanism so that a kqueue object is never destroyed while multiple threads are using it. * Improve scalability by using red-black trees instead of linked lists. * Refactor the internal API to promote modularity and code reuse. Five methods are added to each filter: create, modify, delete, enable, disable. These replace the copyin() method, which was overly complicated. * Remove the fine-grained locking at the filter level, and replace it with coarse locking inside kevent(). This simplifys the locking implementation and provides a stronger guarantee of reentrancy. * Initial attempt at writing a Linux kernel module. It fails to link because sys_epoll_create() and other event-related syscalls are not available to kernelspace (?). Need to ask LKML for guidance. * Make unit tests threadsafe and created a stresstest which runs the unit tests in parallel. * Use helper functions to reduce the amount of duplicate code in the unit tests. 2009-12-26 v0.4 r133 ------------------------------------------------------------------------ * Incomplete and experimental support for Solaris added. * Lots of work on the test suite. * Replace the buggy GC thread with an event-based alternative. * Do not implicitly set EV_CLEAR in the EVFILT_USER filter. * Adjust the eventlist when EV_RECEIPT causes it to be modified. 2009-11-10 v0.3 r84 ------------------------------------------------------------------------ * The EVFILT_USER filter has been implemented, but needs additional testing. * The EVFILT_PROC filter is partially implemented on Linux, but is currently broken. * The unit tests have been moved to a separate subdirectory and now function under OpenBSD 4.4 using the native kqueue(2) and kevent(2) system calls. * The kqueue_free() function has been removed. * A helper thread performs garbage collection when close(2) is called on the file descriptor returned by kqueue(). * All symbols in that are not implemented are now undefined. * Major internal reorganization of the source tree. * A copy-and-paste error in vnode.c has been fixed. * The pthreads library is now required. 2009-11-07 v0.2 r59 ------------------------------------------------------------------------ * Implement EVFILT_TIMER on Linux. * Fix another 'make install' problem reported by Mario Schwalbe. * Do not link the test program with the pthreads library. * pkg-config no longer requires linking with -lpthread and -lrt. 2009-11-05 v0.1 r49 ------------------------------------------------------------------------ * Initial stable release.