atomic_add_return(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ atomic_add_return ✨

ok so this is a page from the Kernel API Manual β€” welcome to atomic_add_return(9), bestie πŸ’…


🌸 NAME 🌸

atomic_add_return β€” atomic add with full ordering πŸ”₯ (yes, full ordering, she does not do half measures)


πŸŽ€ SYNOPSIS πŸŽ€

int atomic_add_return (int i , atomic_t *v );

πŸ’– ARGUMENTS πŸ’–

  • i β€” the int value to add πŸ“
  • v β€” pointer to an atomic_t πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what she does: atomically updates v to (v + i) with full ordering ✨. Atomic and fully ordered, the whole package, no cap.

🚨 real talk though β€” it is unsafe to use in noinstr code; use raw_atomic_add_return there instead. Do not come for me, that's just the rules πŸ™ˆ

⭐ RETURN ⭐

The updated value of v πŸ’– (that's the whole point of the _return, iykyk)


🌈 SEE ALSO 🌈

bestie there are SO many siblings, buckle up 🫢 β€” all of these live in the kernel file ./include/linux/atomic/atomic-instrumented.h

πŸ’œ the atomic_ girlies

πŸ’™ the atomic64_ squad

🧚 the atomic_long_ crew


ok that's the whole roster, she's got a BIG family, we stan a supportive atomic dynasty πŸ‘‘πŸ’–

and that's a wrap!! this page came from the source/path ./include/linux/atomic and it's dated October 2026 β€” ty for reading bestie, go be atomic and fully ordered out there πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from