FUTEX_REQUEUE(2const)

πŸ’– FUTEX_REQUEUE β€” it's giving "wake some besties, shuffle the rest" πŸ’–

okay so bestie, this is a 2const page from the Linux man-pages situation, and it's all about the FUTEX_REQUEUE operation. Pull up a chair, grab a boba, we're doing kernel-adjacent lore 🧚✨

🌸 NAME 🌸

FUTEX_REQUEUE β€” wake some waiters, and requeue others 🫢

πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) β€” the classic, no cap.

✨ SYNOPSIS ✨

#include <linux/futex.h>  /* Definition of FUTEX_* constants */
#include <sys/syscall.h>  /* Definition of SYS_* constants */
#include <unistd.h>

long syscall(SYS_futex, uint32_t *uaddr, FUTEX_REQUEUE,
             uint32_t val, uint32_t val2, uint32_t *uaddr2);

like yes, you're calling syscall() directly, main character energy fr fr. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: this operation does the exact same task as FUTEX_CMP_REQUEUE(2const) β€” literally the same job, same vibes β€” except that the futex word isn't compared. that's it. that's the difference. no vibe check on the futex word, no comparison, we simply move different. πŸ’…

πŸ”₯ RETURN VALUE πŸ”₯

  • on error bestie? it returns -1, and errno gets set to tell you what went wrong. rude but informative 😭
  • on success, FUTEX_REQUEUE returns the number of waiters that were woken up. slay. those are your freshly-awakened besties ✨

πŸ’€ ERRORS πŸ’€

first up: also see futex(2), that's the big lore page.

  • EFAULT β€” uaddr2 didn't point to a valid user-space address. like, that address is not a real place, it's giving void 🫠
  • EINVAL β€” uaddr2 doesn't point to a valid object β€” meaning the address is not four-byte-aligned. misaligned? not the vibe. nope.
  • EINVAL β€” the kernel detected an inconsistency between the user-space state at uaddr and the kernel state β€” that is, it detected a waiter which waits in FUTEX_LOCK_PI(2const) or FUTEX_LOCK_PI2(2const) on uaddr. yes that's the same EINVAL, two whole reasons, we stay thorough πŸ’œ

🌈 STANDARDS 🌈

Linux. just Linux. iconic of it, honestly.

⭐ HISTORY ⭐

Linux 2.6.0 β€” an elder. a pioneer. we respect the ancestors πŸŽ€

πŸ‘€ SEE ALSO πŸ‘€


lowkey if you're here, you're already deep in the futex trenches, and honestly? obsessed. 🫢

and that's the whole page bestie!! this one's from Linux man-pages 6.20, dated 2025-05-30, and it's the FUTEX_REQUEUE(2const) page β€” periodt. πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms