raw_atomic_l...inc_not_zero(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so welcome to the Kernel API Manual, bestie β€” the page header goes raw_atomic_l...inc_not_zero(9), and the full function name is raw_atomic_long_inc_not_zero πŸŽ€. Its whole thing is β€œatomic increment unless zero with full ordering,” and honestly? That’s a very specific slay. πŸ’…


✨ SYNOPSIS ✨

bool raw_atomic_long_inc_not_zero (atomic_long_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic_long_t 🌸

πŸ¦‹ DESCRIPTION πŸ¦‹

If (v != 0), it atomically updates v to (v + 1) with full ordering ✨. Otherwise, v is not modified and relaxed ordering is provided.

It’s safe to use in noinstr code; prefer atomic_long_inc_not_zero elsewhere 🫢.

bestie, that noinstr part is the special little doorway β€” use this raw one there, and use the regular one everywhere else. no cap. πŸ’€

🌈 RETURN 🌈

true if v was updated, false otherwise πŸ‘‘.


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file: ./include/linux/atomic/atomic-long.h πŸ“

and these besties, all together:


mwah πŸ’‹ the source/version spot at the bottom is ./include/linux/atomic, the date is October 2026, and the header is still out here looking like raw_atomic_l...inc_not_zero(9) 🫢 bye bestie!

πŸ“¦ where this page comes from