futex_atomic...inuser_local(9)
β¨ futex_atomic_op_inuser_local(9) β¨
okay so bestie, we're in the Kernel API Manual today and this one is a whole function for doing atomic math on a futex value and then checking whether it matched π like β atomic arithmetic op with a constant argument, PLUS a comparison of the previous futex value against another constant. two jobs, one function, main character energy fr fr π
πΈ NAME πΈ
futex_atomic_op_inuser_local β Atomic arithmetic operation with constant argument and comparison of the previous futex value with another constant.
yes bestie that NAME line is the entire plot π read it twice, it's dense but it ate.
π¦ SYNOPSIS π¦
int futex_atomic_op_inuser_local (int op , u32 oparg , int *oval , u32
__user *uaddr );
four params, one int coming back at you, no cap β¨
π ARGUMENTS π
opβ the operation to execute π this is the what are we even doing of it allopargβ argument of the operation π the constant you're feeding inovalβ previous value atuaddron successful return πΈ so if it slays, the old value gets parked hereuaddrβ pointer to user space address π¦ yeah it's au32 __user *, it's pointing into userspace, be normal about it
π₯ RETURN π₯
0β on success π we love a zero, flawless victory, periodt-EFAULTβ user access resulted in a page fault π the address was not it-EAGAINβ atomic operation was unable to complete due to contention π somebody else was in the way, try again-ENOSYSβ operation not supported π this op is simply not invited to the party
ngl bestie, always check your return value. 0 is the only one that's giving happy ending π
β SEE ALSO β
- Kernel file
./include/asm-generic/futex.hβ go read the source, it's right there π«Ά futex_atomic_cmpxchg_inatomic_local(9)β the sibling function, same energy, different vibe π
okay that's the whole page, you ate that π this lil beauty lives under ./include/asm-generic, dated October 2026, and it's filed as futex_atomic...inuser_local(9) in the Kernel API Manual β mwah, go forth and futex responsibly bestie π
β¨π§
π¦ 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