io_uring_submit_and_wait(3)
β¨ io_uring_submit_and_wait(3) β¨
okay bestie, welcome to liburing's manual pages, you're gonna slay this π«Ά
πΈ NAME πΈ
io_uring_submit_and_wait β drop your requests into the submission queue and hang around for the completion, all in one go π
π SYNOPSIS π
#include <liburing.h>
int io_uring_submit_and_wait(struct io_uring *ring,
unsigned wait_nr);
π¦ DESCRIPTION π¦
so, io_uring_submit_and_wait(3) does exactly what it says on the tin, no cap: it submits the next requests sitting in the submission queue of the ring you pass in, and then it waits for wait_nr completion events. two jobs, one function call, iconic behaviour honestly.
the flow is like this: first you grab a submission queue entry (an SQE) with io_uring_get_sqe(3), you prep it however you need it, and then you ship it off with io_uring_submit_and_wait(3). that's the whole vibe β¨
π pro move: this thing is ideally used with a ring that was set up with IORING_SETUP_SINGLE_ISSUER|IORING_SETUP_DEFER_TASKRUN, because that combo greatly reduces the number of context switches your application will see when it's waiting on a bunch of requests at once. fewer context switches = happier app, periodt.
π RETURN VALUE π
- on success,
io_uring_submit_and_wait(3)returns the number of submitted submission queue entries π - on failure, it returns -errno π
π₯ SEE ALSO π₯
io_uring_queue_init_params(3)io_uring_get_sqe(3)io_uring_submit(3)io_uring_submit_and_wait_timeout(3)
and that's the tea π this page is from liburing-2.1, dated November 15, 2021, and it lives in the liburing manual. go forth and submit responsibly, bestie ππ§
π¦ 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) 2021 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