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
kqueue: set proper errno for no threadpool, handle errnos properly #57
When an operation requesting a threadpool is registered with a loop that has no threadpool, we set the result to EPERM. We were forgetting to negate the result so we were seeing it as a success.
We used errno() to process results, but for manually constructed errnos (like the above), we'd read an invalid value because we don't actually set the errno threadlocal... and don't want to.
We didn't have cancellation and permission denied as part of the error sets because we never hit them! Now we do! As we should.
Fixes #54
This fixes a few issues:
When an operation requesting a threadpool is registered with a loop that has no threadpool, we set the result to EPERM. We were forgetting to negate the result so we were seeing it as a success.
We used
errno()
to process results, but for manually constructed errnos (like the above), we'd read an invalid value because we don't actually set the errno threadlocal... and don't want to.We didn't have cancellation and permission denied as part of the error sets because we never hit them! Now we do! As we should.