(no title)
mahkoh | 1 year ago
One of the advantages of io_uring, unrelated to performance, is that it supports non-blocking operations on blocking file descriptors.
Using io_uring is the only method I recall to bypass https://gitlab.freedesktop.org/wayland/wayland/-/issues/296. This issue deals with having to operate on untrusted file descriptors where the blocking/non-blocking state of the file descriptions might be manipulated by an adversary at any time.
kragen|1 year ago
o11c|1 year ago
For sockets, `MSG_DONTWAIT` works with both `recv` and `send`.
For pipes you should be able to do this with `SPLICE_F_NONBLOCK` and the `splice` family, but there are weird restrictions for those.
lukeh|1 year ago