FUTEX_LOCK_PI2(2const)
💖 FUTEX_LOCK_PI2 💖
okay so bestie, welcome to FUTEX_LOCK_PI2 — it's a 2const manual page, and it's literally about locking a priority-inheritance futex. yes we're doing kernel things today, and yes you're gonna slay it 🫶
It lives in the Standard C library (libc, -lc). iconic behavior honestly.
✨ 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_LOCK_PI2, 0,
const struct timespec *timeout);
like yes you're calling syscall(2) directly, main character energy, no wrapper, periodt 💅
🌸 DESCRIPTION 🌸
So this operation is the same as FUTEX_LOCK_PI(2const) — like, same vibes, same lock, same priority inheritance — except for one little glow-up: the clock that timeout gets measured against is selectable. that's the whole flex. 🦋
By default, the (absolute) timeout you pass in timeout is measured against the CLOCK_MONOTONIC clock. no cap.
🎀 RETURN VALUE 🎀
Go read FUTEX_LOCK_PI(2const), bestie. it's all there. 📖
💀 ERRORS 💀
Also FUTEX_LOCK_PI(2const). same page, same energy. go look 👀
⭐ STANDARDS ⭐
Linux. that's it. that's the standard. 🐧
🕰️ HISTORY 🕰️
It showed up in Linux 5.14. a whole era. 👑
🔥 SEE ALSO 🔥
ngl, if you were hoping for a long list of flags to memorize, this is not that page. this one is short, sweet, and points you straight at FUTEX_LOCK_PI(2const). iykyk 💜
okay bye bestie, go lock some futexes responsibly 💖✨
— written up in Linux man-pages 6.20, dated 2025-05-30. 🎀🌈
📦 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