jiixyj / epoll-shim

small epoll implementation using kqueue; includes all features needed for libinput/libevdev
MIT License
91 stars 24 forks source link

epoll-shim

This is a small library that implements epoll on top of kqueue. It has been successfully used to port libinput, libevdev, Wayland and more software to FreeBSD: https://www.freshports.org/devel/libepoll-shim/

It may be useful for porting other software that uses epoll as well.

There are some tests inside test/. They should also compile under Linux and can be used to verify proper epoll behavior.

Sadly, this library contains some very ugly hacks and workarounds. For example:

The library is tested on the following operating systems:

Be aware of some subtle kqueue bugs that may affect the emulated epoll behavior. I've marked tests that hit those behaviors as "skipped". Have a look at atf_tc_skip() calls in the tests.

Installation

Run the following commands to build libepoll-shim:

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build .

To run the tests:

ctest --output-on-failure

To install (as root):

cmake --build . --target install

Changelog

2024-06-08

2023-04-11

2023-01-28

2022-07-03

2022-06-07

2021-04-18

2021-04-17

2021-03-22

2021-03-21

2021-03-10

2021-02-13

2020-12-29

2020-11-06

2020-06-02

2020-04-25

2020-04-08