io_uring_prep_futex_wake(3)
π io_uring_prep_futex_wake β bestie, it's a manual page π
okay so this is io_uring_prep_futex_wake(3) from the liburing Manual, and no cap, it's lowkey iconic once it clicks. let's get into it π«Ά
β¨ NAME β¨
io_uring_prep_futex_wake β get a futex wake request ready to go π
π¦ SYNOPSIS π¦
#include <linux/futex.h>
#include <unistd.h>
#include <liburing.h>
void io_uring_prep_futex_wake(struct io_uring_sqe *sqe,
const uint32_t *futex,
uint64_t val,
uint64_t mask,
uint32_t futex_flags,
unsigned int flags);
like look at her. so many little arguments. she's giving main character energy fr fr β¨
πΈ DESCRIPTION πΈ
so the io_uring_prep_futex_wake(3) function literally prepares a futex wake request. that's it, that's the job. π
the submission queue entry sqe gets set up for waking any waiters on the futex indicated by futex, and it wakes at most val futexes. like, don't be greedy bestie, val is the cap. π
futex_flags is where you drop the futex2(2) modifier flags, and the io_uring futex flags go in flags.
if you want a specific bitset for who gets to wake up β like a lil VIP list β you gotta set that in mask. and if you want literally anyone on the given futex to match, use FUTEX_BITSET_MATCH_ANY. easy. π
flags is currently unused, so you must pass 0. don't get creative, there's nothing to put there. π
this function prepares an async futex(2) wake request, so go peep that man page for the deets. and here's the tea: the io_uring futex wake request is similar to the FUTEX_WAKE_BITSET operation, because FUTEX_WAKE is a strict subset of that. so like... bitset is the whole vibe, wake is just a lil slice of it. π
available since kernel 6.7. mark your calendars bestie ποΈβ¨
π RETURN VALUE π
None. she returns nothing. void. silent. mysterious. π
π ERRORS π
the CQE res field is gonna hold the result of the operation. on success, the value will be the index into futexv which received a wakeup. wild, right? check the related man page for what the possible error values are. π
important bestie, do not skip this: where synchronous system calls will return-1on failure and seterrnoto the actual error value, io_uring never useserrno. instead it returns the negatederrnodirectly in theCQE resfield. so stop looking aterrno, she's not coming. πβ¨
π§ SEE ALSO π§
io_uring_get_sqe(3)io_uring_submit(3)io_uring_prep_futex_wait(3)io_uring_prep_futex_waitv(3)futex(2)futex2(2)
and that's the whole page, bestie, you ate that π
sign-off time: this lil masterpiece is from liburing-2.5, dated Sep 29, 2023, and it lives in the liburing Manual like the queen she is. go forth and wake those futexes responsibly, mwah πππ
π¦ where this page comes from
- 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
- 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
- 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 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