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.
While playing with cancellation on an old machine not supporting io_uring, I noticed that it was using the original fd, thus causing a error.FileDescriptorNotRegistered to appear.
Solution
Use the duplicated fd if the completion.flags.dup boolean is set, otherwise fallback to the completion.fd function.
Description
While playing with cancellation on an old machine not supporting
io_uring
, I noticed that it was using the originalfd
, thus causing aerror.FileDescriptorNotRegistered
to appear.Solution
Use the duplicated
fd
if thecompletion.flags.dup
boolean is set, otherwise fallback to thecompletion.fd
function.