io_uring_cqe_get_data(3)
β¨ io_uring_cqe_get_data β get user data for completion event β¨
okay bestie, so this one is from the liburing manual, and it's genuinely such a vibe once you get it. it's giving "the completion came back, now who sent it??" π¦
πΈ SYNOPSIS πΈ
#include <liburing.h>
void *io_uring_cqe_get_data(struct io_uring_cqe *cqe);
__u64 io_uring_cqe_get_data64(struct io_uring_cqe *cqe);
literally just two little functions, both taking a cqe, both handing you back your user_data. slay. π
π DESCRIPTION π
so here's the tea, bestie π
The io_uring_cqe_get_data(3) function returns the user_data with the completion queue entry cqe as a data pointer.
The io_uring_cqe_get_data64(3) function returns the user_data with the completion queue entry cqe as a 64-bit data value.
the way that this works: after the caller has received a completion queue entry (CQE) with io_uring_wait_cqe(3), the application can call io_uring_cqe_get_data(3) or io_uring_cqe_get_data64(3) function to retrieve the user_data value. π«Ά
and likeβ¦ this requires that user_data has been set earlier with the function io_uring_sqe_set_data(3) or io_uring_sqe_set_data64(3). so it's a matching set, okay? you put the little name tag on the way out, you read the name tag on the way back. iconic behavior. π
β RETURN VALUE β
If the user_data value has been set before submitting the request, it will be returned.
Otherwise, the return value is undefined. π like not "oh it returns NULL" β undefined. so set your data, bestie. don't be out here rawdogging it and then acting surprised. π
fr fr: no user_data set means you get whatever, and "whatever" is not a guarantee. main character energy requires preparation. π
π SEE ALSO π
io_uring_get_sqe(3)io_uring_sqe_set_data(3)io_uring_sqe_submit(3)
k bye ily, go tag your SQEs π
this page was served to you by liburing-2.1, dated November 15, 2021 β oldie but a goodie, no cap. π§β¨
π¦ 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 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) 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