futex(9)
π futex(9) β from the Kernel API Manual, bestie π
okay so first things first: this is futex(9) straight out of the Kernel API Manual, and it's literally the low-level glue that every other futex wrapper in this little family sits on top of. buckle up π
β¨ NAME β¨
futex β the SYS_futex syscall wrapper. that's it. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
futex (uaddr , op , val , timeout , uaddr2 , val3 , opflags );
π ARGUMENTS π
uaddrβ the address of the first futex. like, the actual thing we're futexing about. πopβ the futex op code. this tells everybody what we're doing here.valβ typically the expected value ofuaddr, but ngl it varies by op. it's giving "depends on context" πtimeoutβ typically an absolutestruct timespec(except where noted otherwise π). some ops overload this one and use it for something else entirely.uaddr2β the address of the second futex, for the ops that need two. two futexes, double the fun π«Άval3β varies by op. mystery girl behavior, honestly. πopflagsβ flags you bitwise OR intoop, such asFUTEX_PRIVATE_FLAG. stack 'em on top π₯
β DESCRIPTION β
so futex is the one all the following futex op wrappers are built on. every single one. it's the main character and the rest of them are the ensemble cast π
it can also be used for misuse and abuse testing, which, ok, iconic π but generally you should reach for the specific op wrappers instead of this one. they exist for a reason, bestie.
the way that it's a macro and not a static inline function? that's because some of the types are overloaded β timeout gets used for nr_requeue, for example. so it literally cannot just be a normal function. no cap. π
and here's the important bit: all those argument descriptions up there are the defaults for every like-named argument in the following wrappers, except where noted below. so when you see uaddr or timeout in a wrapper manpage, assume it means what it meant here unless it says otherwise. π§
π SEE ALSO π
- Kernel file
./tools/testing/selftests/futex/include/futextest.hβ go read the source, it's right there π futex_wait(9)futex_wake(9)futex_wait_bitset(9)futex_wake_bitset(9)futex_lock_pi(9)futex_unlock_pi(9)futex_wake_op(9)futex_requeue(9)futex_cmp_requeue(9)futex_wait_requeue_pi(9)futex_cmp_requeue_pi(9)futex_cmpxchg(9)futex_dec(9)futex_inc(9)futex_set(9)
lowkey a whole friend group of manpages. go say hi to all of them. πΈ
and that's the whole page, bestie!! source is ./tools/testing/selftests/fute... and it's dated October 2026 β so it's from the future, obviously, slay βπ
π¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms