atomic_fetch_inc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 atomic_fetch_inc β€” atomic increment with full ordering πŸ’…

okay bestie, so this is page atomic_fetch_inc(9) from the Kernel API Manual, and honestly? she's a whole vibe. let's get into it ✨


πŸŽ€ NAME

atomic_fetch_inc β€” atomic increment with full ordering. that's it, that's the girl. πŸ’–


✨ SYNOPSIS

int atomic_fetch_inc (atomic_t *v );

πŸ¦‹ ARGUMENTS

  • v β€” pointer to atomic_t. just a lil pointer to the thing you wanna bump. 🫢

πŸ‘‘ DESCRIPTION

so here's the tea: this function atomically updates v to (v + 1) β€” with full ordering, no cap. it's giving "I incremented it and nobody can fight me about it" energy. πŸ”₯

⚠️ real talk though: this one is unsafe to use in noinstr code. if you're in there, use raw_atomic_fetch_inc instead. not me warning you so you don't crash on main πŸ’€

🌈 RETURN

it returns the original value of v β€” like, the value before she incremented. pre-glow-up energy, iykyk. πŸ’œ


🌟 SEE ALSO

the kernel file this lives in is ./include/linux/atomic/atomic-instrumented.h β€” and bestie, the family tree here is enormous. like the whole group chat showed up. ✨

the atomic_* crew πŸ’…

the atomic64_* crew (she's 64-bit and thriving) πŸ’–

the atomic_long_* crew (long may she reign) 🌈


and that's the whole page, bestie 🫢 this one came from ./include/linux/atomic, dated October 2026 β€” so like, future icon behaviour fr fr. stay atomic, stay ordered, and don't forget raw_atomic_fetch_inc in noinstr code. mwah πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from