futex(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 of uaddr, but ngl it varies by op. it's giving "depends on context" πŸ’…
  • timeout β€” typically an absolute struct 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 into op, such as FUTEX_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 🌈


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