raw_atomic_inc_not_zero(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ raw_atomic_inc_not_zero(9) β€” Kernel API Manual, bestie πŸ’–

πŸ’– NAME πŸ’–

raw_atomic_inc_not_zero β€” atomic increment unless zero with full ordering. Yes bestie, that's the whole name and it ate. ✨


✨ SYNOPSIS ✨

bool raw_atomic_inc_not_zero (atomic_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic_t. It's giving pointer royalty πŸ‘‘, not the value itself, just the address.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this πŸ’­ β€” if (v != 0), this function atomically updates v to (v + 1) with full ordering. Slay, that's the magic. πŸͺ„

otherwise β€” as in when v is zero β€” v is not modified and relaxed ordering is provided. No cap, it just sits there looking cute. 😌

it's safe to use in noinstr code πŸ›‘οΈ β€” but outside that vibe, prefer atomic_inc_not_zero elsewhere. iykyk. πŸ’…

🚨 bestie safety note: raw_atomic_inc_not_zero is safe in noinstr code; the general-purpose pick is atomic_inc_not_zero.

🌸 RETURN 🌸

  • true β€” if v was updated, bestie, it moved. βœ…
  • false β€” otherwise, it didn't update. πŸ’€

simple as that, no cap. ✨


πŸ’… SEE ALSO πŸ’…


source/version tea: ./include/linux/atomic β€’ date: October 2026 β€’ and that's the teeeeaaa, bestie πŸ«ΆπŸŽ€βœ¨

πŸ“¦ where this page comes from