raw_atomic_long_fetch_inc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_long_fetch_inc β€” Kernel API Manual ✨

okay bestie, gather round because we're talking about raw_atomic_long_fetch_inc β€” the manual page is literally called Kernel API Manual, and this function is atomic increment with full ordering. yes. that's the whole vibe. let's get into it πŸŽ€


✨ SYNOPSIS ✨

long raw_atomic_long_fetch_inc (atomic_long_t *v );

one function, one pointer, zero drama. (well, some drama β€” it's atomic πŸ’€)


🌸 ARGUMENTS 🌸

  • v β€” pointer to atomic_long_t. that's it. that's the whole arg list. she's low maintenance πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she actually do? she atomically updates v to (v + 1) with full ordering. like, the whole package. not relaxed, not acquire, not release β€” full ordering, no cap πŸ’…

Safe to use in noinstr code β€” yes, this one is allowed in the noinstr club 🫢

but also, lowkey important: prefer atomic_long_fetch_inc elsewhere. this raw version is the special-occasion one, iykyk. don't be out here using the raw one in normal code just because it looks cool 😭


⭐ RETURN ⭐

she gives you back the original value of v β€” i.e. what it was before the increment. so if v was 41, you get 41 and v becomes 42. iconic behaviour, honestly πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

the whole extended friend group, fr fr. first up, the kernel file:

  • Kernel file ./include/linux/atomic/atomic-long.h

then the entire squad, in order:


πŸ’– mwah, that's the page πŸ’– sourced from ./include/linux/atomic, dated October 2026, and it's the raw_atomic_long_fetch_inc(9) page from the Kernel API Manual. go forth and increment responsibly bestie πŸ¦‹βœ¨

πŸ“¦ where this page comes from