From e460ba66a57f0a4e0ee07f32cef17c7f2bf290b4 Mon Sep 17 00:00:00 2001 From: Constantin Pestka <38702187+CPestka@users.noreply.github.com> Date: Tue, 30 Jan 2024 03:26:52 +0100 Subject: [PATCH] std: add docs about return value of submit() (#18721) being misleading if used alongside with IORING_SETUP_SQPOLL --- lib/std/os/linux/io_uring.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/std/os/linux/io_uring.zig b/lib/std/os/linux/io_uring.zig index 8232db813e..17c589574d 100644 --- a/lib/std/os/linux/io_uring.zig +++ b/lib/std/os/linux/io_uring.zig @@ -144,7 +144,10 @@ pub const IO_Uring = struct { /// Submits the SQEs acquired via get_sqe() to the kernel. You can call this once after you have /// called get_sqe() multiple times to setup multiple I/O requests. - /// Returns the number of SQEs submitted. + /// Returns the number of SQEs submitted, if not used alongside IORING_SETUP_SQPOLL. + /// If the io_uring instance is uses IORING_SETUP_SQPOLL, the value returned on success is not + /// guaranteed to match the amount of actually submitted sqes during this call. A value higher + /// or lower, including 0, may be returned. /// Matches the implementation of io_uring_submit() in liburing. pub fn submit(self: *IO_Uring) !u32 { return self.submit_and_wait(0);