raw_atomic_l...turn_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_l...turn_acquire(9) πŸ’…

okay bestie, so we're in the Kernel API Manual today and honestly? this one is a lil gem. it's the raw atomic long add-with-acquire-ordering situation, and yes, the name is a whole mouthful, we're getting through it together 🫢


✨ NAME ✨

raw_atomic_long_add_return_acquire β€” atomic add but make it acquire-ordered πŸ‘‘


🌸 SYNOPSIS 🌸

long raw_atomic_long_add_return_acquire (long i , atomic_long_t *v );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” the long value you wanna add. just a number, no drama πŸ’…
  • v β€” a pointer to your atomic_long_t. this is the main character, the thing getting updated ✨

πŸŽ€ DESCRIPTION πŸŽ€

so what it does is: atomically updates v to (v + i), and it does the whole thing with acquire ordering. like, it's not just adding, it's adding with vibes (the vibes being memory-ordering guarantees, ngl that's the important part).

and here's the tea πŸ“ β€” it's safe to use in noinstr code. but if you're not in noinstr code? prefer atomic_long_add_return_acquire instead, fr fr. this raw one is for the special occasions.


⭐ RETURN ⭐

the updated value of v. that's it, that's the return. the new number, fresh out the update πŸ’–


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./include/linux/atomic/atomic-long.h β€” go look, she's iconic:

like, that's the whole family reunion right there and every single one of them showed up 🌈


quick reminder bestie: this is the raw version, so if you're not writing noinstr code, go hang out with atomic_long_add_return_acquire instead. she's the friendly one πŸ’œ

and that's a wrap! 🌸 this page came out of ./include/linux/atomic and it's dated October 2026, so like, mark your calendar, mwah πŸ’‹

πŸ“¦ where this page comes from