io_uring_cq_advance(3)
π io_uring_cq_advance(3) β liburing Manual π
okay bestie, welcome to the liburing girlies' guide to telling the kernel "yeah I saw that, next" π
β¨ NAME β¨
io_uring_cq_advance β mark one or more io_uring completion events as consumed
πΈ SYNOPSIS πΈ
#include <liburing.h>
void io_uring_cq_advance(struct io_uring *ring,
unsigned nr);
π¦ DESCRIPTION π¦
so like, io_uring_cq_advance(3) marks nr IO completions belonging to the ring param as consumed. that's it. that's the whole job. no cap. π
here's the vibe: after the caller has submitted a request with io_uring_submit(3), the application can retrieve the completion with io_uring_wait_cqe(3), io_uring_peek_cqe(3), or any of the other CQE retrieval helpers, and then mark it as consumed with io_uring_cqe_seen(3). iconic behavior honestly. β¨
and plot twist β the function io_uring_cqe_seen(3) calls the function io_uring_cq_advance(3). so it's giving "you've been calling it this whole time without knowing." π
now listen up because this is the important part π: completions must be marked as seen, so their slot can get reused. failure to do so will result in the same completion being returned on the next invocation. that's not a cute little quirk, that's a bug in your app. don't be that girl. π«
π RETURN VALUE π
None π β it's a void function, she returns nothing, she just does.
π SEE ALSO π
io_uring_submit(3)io_uring_wait_cqe(3)io_uring_peek_cqe(3)io_uring_wait_cqes(3)io_uring_wait_cqe_timeout(3)io_uring_cqe_seen(3)
and that's the whole page bestie π«Ά this one's from liburing-2.1, dated January 25, 2022 β so she's an elder but she's still slaying. go advance those completions, you're literally the main character of your own event loop. 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 bookworm: liburing-dev 2.3-3
- 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 noble: liburing-dev 2.5-1build1
- 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) 2022 Stefan Roesch <shr@fb.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms