liburing icon indicating copy to clipboard operation
liburing copied to clipboard

liburing, man: make io_uring_sqring_wait() more consistent with API

Open dmantipov opened this issue 2 years ago • 1 comments

Make io_uring_sqring_wait() return an amount of free SQ ring entries or -EINVAL if the ring was not setup with IORING_SETUP_SQPOLL, adjust manual page accordingly.

Signed-off-by: Dmitry Antipov [email protected]

dmantipov avatar Dec 05 '22 14:12 dmantipov

NOTE: IIUC this requires the following kernel change as well:

diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 559652380672..7fc1b388ed90 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -327,7 +327,7 @@ int io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
        } while (!signal_pending(current));
 
        finish_wait(&ctx->sqo_sq_wait, &wait);
-       return 0;
+       return io_sqring_entries(ctx);
 }
 
 __cold int io_sq_offload_create(struct io_ring_ctx *ctx,

dmantipov avatar Dec 05 '22 14:12 dmantipov