futex_atomic...inuser_local(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 all
  • oparg β€” argument of the operation πŸ“ the constant you're feeding in
  • oval β€” previous value at uaddr on successful return 🌸 so if it slays, the old value gets parked here
  • uaddr β€” pointer to user space address πŸ¦‹ yeah it's a u32 __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