mitchellh / libxev

libxev is a cross-platform, high-performance event loop that provides abstractions for non-blocking IO, timers, events, and more and works on Linux (io_uring or epoll), macOS (kqueue), and Wasm + WASI. Available as both a Zig and C API.
MIT License
2.07k stars 74 forks source link

Process watching, poll ops for io_uring/epoll #29

Closed mitchellh closed 1 year ago

mitchellh commented 1 year ago

This implements process watching (#12) for io_uring and epoll.

To facilitate this, io_uring and epoll now both have a poll operation which only polls for some events and then notifies of readiness rather than performing any actual work. These are used to enable process watching.

Process watching itself for these platforms are implemented using pidfd.

kqueue will follow in a separate PR.