raw_atomic_fetch_dec(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

raw_atomic_fetch_dec(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual page for raw_atomic_fetch_dec β€” atomic decrement with full ordering, and yes she is lowkey iconic. It takes an atomic_t and hands you back the old value. no cap. πŸ¦‹


NAME πŸŽ€

raw_atomic_fetch_dec β€” atomic decrement with full ordering.

SYNOPSIS ✨

int raw_atomic_fetch_dec (atomic_t *v );

ARGUMENTS 🌸

  • v β€” pointer to atomic_t. that's the counter you're about to send one step backwards, bestie.

DESCRIPTION πŸ’–

Atomically updates v to (v - 1) with full ordering. Like, the whole operation is one indivisible glow-up β€” nobody gets to peek at a half-done decrement. ✨

Safe to use in noinstr code; prefer atomic_fetch_dec elsewhere. So if you're in noinstr land, slay, this is your function. If you're not, the manual is literally telling you to prefer atomic_fetch_dec β€” respect the vibe check. 🫢

RETURN 🎁

The original value of v. Not the new one β€” the value from before the decrement. She gives you the before pic, not the after. πŸ’…

SEE ALSO πŸ‘‘

This one lives in the kernel file ./include/linux/atomic/atomic-arch-fallback.h, and the whole raw atomic family is here to say hi. Literally the group chat:

and now the 64-bit girlies, because they also said hi:

mwah πŸ’‹ β€” this cutie comes from ./include/linux/atomic, dated October 2026.

πŸ“¦ where this page comes from