raw_atomic_long_fetch_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_long_fetch_add β€” the kernel API manual, but make it make sense

okay so bestie, you've wandered into the Kernel API Manual and landed on raw_atomic_long_fetch_add. Sit down, grab a strawberry drink πŸ“, because this one's actually lowkey adorable once you get it.


✨ NAME ✨

raw_atomic_long_fetch_add β€” atomic add, but make it fully ordered πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

long raw_atomic_long_fetch_add (long i , atomic_long_t *v );

🌸 DESCRIPTION 🌸

So here's the vibe: this function atomically updates v to (v + i) with full ordering. Like, atomic-atomic. Nobody's catching this halfway through, no cap. πŸ”₯

It's safe to use in noinstr code β€” that's its whole moment, its main character energy. Everywhere else though? Prefer atomic_long_fetch_add. Fr fr. It's giving "yes I can do this, but like, do you need me to". πŸ™ˆ


πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” a long value to add. That's it, that's the number. ✨
  • v β€” pointer to an atomic_long_t. This is the thing getting updated, the icon, the moment. πŸ‘‘

πŸ‘‘ RETURN πŸ‘‘

The original value of v. Not the new one β€” the before picture. Picture it: you asked "what was it", and it tells you. So fetch. Much slay. 🫢


🌈 SEE ALSO 🌈

Okay the friend group is large, buckle in. All of these, periodt:

And the source file itself, the origin story: ./include/linux/atomic/atomic-long.h β€” go read it, it's giving homework but the slay kind. πŸ’œ


mwah πŸ’‹ that's the whole page. sourced straight from ./include/linux/atomic, dated October 2026 β€” and it's still raw_atomic_long_fetch_add(9) at the bottom, bestie, we just made it cute. πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from