io_uring_wai..._min_timeout(3)
π io_uring_wai..._min_timeout β liburing Manual π
okay bestie, gather round, because this one is a liburing page (yes, the manual, the one that ships with liburing) and it's giving "wait for completions but make it β¨fancyβ¨". sit down, sip ur drink, let's go π
β¨ NAME β¨
io_uring_wait_cqes_min_timeout β wait for completions with both a batch timeout and a normal timeout. two timeouts. double the drama. π
πΈ SYNOPSIS πΈ
#include <liburing.h>
int io_uring_wait_cqes_min_timeout(struct io_uring *ring,
struct io_uring_cqe **cqe_ptr,
unsigned wait_nr,
struct __kernel_timespec *ts,
unsigned int min_wait_usec,
sigset_t *sigmask);
π¦ DESCRIPTION π¦
so like, io_uring_wait_cqes_min_timeout(3) waits for completions from the submission queue that belongs to the ring π β and it's waiting for wait_nr completion events, or until the timeout ts expires. whichever comes first, no cap.
those completion events get stored in the cqe_ptr array. and if it's non-zero, min_wait_usec denotes a timeout for the wait_nr batch. cute, right?
now, sigmask specifies the set of signals to block. if it's set, it's equivalent to atomically executing these calls β like, all together, as one vibe:
sigset_t origmask;
pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
ret = io_uring_wait_cqes_min_timeout(ring, cqe, wait_nr, ts, min_wait, NULL);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
this works like io_uring_submit_and_wait_min_timeout(3) except that it doesn't submit requests. that's the whole difference, bestie. if you wanna know how the min timeout waiting actually works, go read that man page β it explains the whole thing. π«Ά
available since 6.12 β (yes, kernel version, mark ur calendar)
π₯ RETURN VALUE π₯
on success, io_uring_wait_cqes_min_timeout(3) returns 0. icon.
on failure it returns -errno. and if the kernel doesn't support this functionality, you get -EINVAL back β see the note on the feature flag, ok? π
the most common failure case? not receiving a completion within the specified timeout. in that case -ETIME is returned. it's giving "u waited too long, babe" π
π SEE ALSO π
io_uring_wait_cqe(3)io_uring_wait_cqes(3)io_uring_wait_cqe_timeout(3)io_uring_wait_cqes(3)io_uring_submit_and_wait_min_timeout(3)
that's the whole page, bestie, u ate it π this one's from liburing-2.8, dated Feb 13, 2024 β and it's literally titled io_uring_wai..._min_timeout(3) in the header, footer, and honestly in my heart. periodt. πβ¨
π¦ where this page comes from
- alpine 3.22: liburing-doc 2.9-r0 Β· LGPL-2.1-or-later OR MIT
- alpine 3.23: liburing-doc 2.12-r0 Β· LGPL-2.1-or-later OR MIT
- alpine 3.24: liburing-doc 2.14-r0 Β· LGPL-2.1-or-later OR MIT
- arch rolling: liburing 2.15-1 Β· GPL-2.0-only WITH Linux-syscall-note OR MIT AND LGPL-2.0-or-later AND MIT
- centos-stream 10: liburing-devel 2.12-1.el10 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- debian trixie: liburing-dev 2.9-1
- fedora 43: liburing-devel 2.9-2.fc43 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 43: liburing-devel 2.9-2.fc43 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- nixpkgs unstable: liburing 2.14
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- ubuntu questing: liburing-dev 2.11-1
- ubuntu resolute: liburing-dev 2.14-1
- ubuntu stonking: liburing-dev 2.15-1
- π the page's license: LGPL-2.0-or-later
- Copyright (C) 2024 Jens Axboe <axboe@kernel.dk>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms