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.16k stars 76 forks source link

io_uring: handle INTR error from write #119

Closed rockorager closed 2 months ago

rockorager commented 2 months ago

It is possible to get an EINTR error from io_uring when copying cqes. xev already handles EINTR automatically when it occurs during io_uring_enter, but doesn't handle it if an individual cqe copy has this error.

Add error.SignalInterrupt to the WriteError enum so that callers may rearm their writes when encountering this error, if they desire.