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, anderrnogets set to tell you what went wrong. rude but informative π - on success,
FUTEX_REQUEUEreturns 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βuaddr2didn't point to a valid user-space address. like, that address is not a real place, it's giving void π«EINVALβuaddr2doesn'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 atuaddrand the kernel state β that is, it detected a waiter which waits inFUTEX_LOCK_PI(2const)orFUTEX_LOCK_PI2(2const)onuaddr. yes that's the sameEINVAL, 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