raw_atomic_long_inc_return(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 raw_atomic_long_inc_return β€” Kernel API Manual 🌸

okay so bestie, gather round, because today's main character is raw_atomic_long_inc_return(9) and it is literally the raw, unfiltered version of an atomic increment. yes, "raw" is right there in the name, she's not hiding it πŸ’…


✨ NAME ✨

raw_atomic_long_inc_return β€” atomic increment with full ordering πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

long raw_atomic_long_inc_return (atomic_long_t *v );

like, that's the whole invocation. one pointer in, one long out, no cap 🫢


πŸ’– ARGUMENTS πŸ’–

  • v β€” pointer to atomic_long_t. she's the one getting incremented, bestie, show her some respect ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

Atomically updates v to (v + 1) with full ordering. that's it, that's the whole vibe β€” one clean, all-or-nothing bump, and the ordering is full, so the memory ordering is doing the absolute most for you πŸ”₯

She's safe to use in noinstr code; prefer atomic_long_inc_return elsewhere. ngl this is the key detail: noinstr gets the raw one, everywhere else you go to atomic_long_inc_return. iykyk πŸ’€


🌈 RETURN 🌈

The updated value of v. so you get the new number back, not the old one β€” post-increment energy, she ate πŸ“


🧚 SEE ALSO 🧚

Kernel file ./include/linux/atomic/atomic-long.h β€” that's the neighborhood she lives in, go say hi 🏑

and the whole extended family, because this API is huge and we love a big family:

okay that was a lot of names but every single one of them matters, we do not skip the boring parts in this house πŸ’œ


quick vibe check, bestie: this page lives at ./include/linux/atomic, dated October 2026, and it's brought to you under the raw_atomic_long_inc_return(9) header β€” that's the kernel API manual doing its thing. go forth and increment atomically, with full ordering, and absolutely slay βœ¨πŸ’…πŸŽ€
πŸ“¦ where this page comes from