raw_atomic_...ess_negative(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 raw_atomic_...ess_negative(9) 🌸

okay bestie, so this is from the Kernel API Manual and it's about raw_atomic_long_inc_unless_negative β€” yes the name is a whole meal and then some, but stay with me, it's actually so good πŸ’…


✨ NAME ✨

raw_atomic_long_inc_unless_negative β€” atomic increment unless negative, with full ordering πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

bool raw_atomic_long_inc_unless_negative (atomic_long_t *v );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • v β€” pointer to atomic_long_t. that's the lil guy you're gonna poke at 🫢

πŸ’œ DESCRIPTION πŸ’œ

okay so if (v >= 0), it atomically updates v to (v + 1) with full ordering. literally doing the most, in the best way ✨

otherwise β€” like if v is negative β€” v is not modified, and you get relaxed ordering instead. no cap, it just sits there πŸ’€

it's safe to use in noinstr code; but please prefer atomic_long_inc_unless_negative everywhere else, iykyk 🌈


πŸ‘‘ RETURN πŸ‘‘

returns true if v was updated, false otherwise. simple as that, periodt πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./include/linux/atomic/atomic-long.h β€” the whole squad lives here 🧚


that's the whole page, and fr fr you ate that πŸ“

source: ./include/linux/atomic Β· dated October 2026 Β· and we're closing out raw_atomic_...ess_negative(9) β€” mwah, main character energy, bye bestie πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from