raw_atomic_inc_return(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– raw_atomic_inc_return(9) πŸ’–

okay so welcome to the Kernel API Manual corner of the group chat 🫢. Today’s main character is raw_atomic_inc_return(9), and she’s giving atomic increment with full ordering and she’s not sorry. πŸ’…


✨ NAME ✨

raw_atomic_inc_return β€” atomic increment with full ordering. No cap, that’s the whole vibe. πŸ’–


πŸ“œ SYNOPSIS πŸ“œ

int raw_atomic_inc_return (atomic_t *v );

🫢 ARGUMENTS 🫢

  • v β€” pointer to atomic_t. That’s it, bestie, just a lil pointer to the atomic thing. πŸŽ€

πŸ’… DESCRIPTION πŸ’…

okay so this one is simple in the best way: it atomically updates v to (v + 1) with full ordering ✨. Yes bestie, full ordering, iconic behavior, we love to see it.

It’s safe to use in noinstr code; everywhere else, prefer atomic_inc_return, periodt. 🫢


🎁 RETURN 🎁

The updated value of v β€” that’s the fresh number after the +1, served with a little bow πŸŽ€. Literally the post-increment glow-up. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

the whole extended fam, plus the kernel file where this lives:


and that’s the vibe check, bestie πŸ’– this page lives in ./include/linux/atomic, dated October 2026, and it’s literally called raw_atomic_inc_return(9). go increment responsibly 🫢✨

πŸ“¦ where this page comes from