raw_atomic_l...sub_and_test(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

raw_atomic_long_sub_and_test(9) πŸ’…βœ¨

okay so bestie, welcome to the Kernel API Manual corner 🫢 today’s main character is raw_atomic_long_sub_and_test, and she is giving atomic subtract + zero check with full ordering. no cap, she’s lowkey iconic.

✨ NAME ✨

raw_atomic_long_sub_and_test β€” atomic subtract and test if zero with full ordering πŸ’–

🌸 SYNOPSIS 🌸

bool raw_atomic_long_sub_and_test (long i , atomic_long_t *v );

🫢 ARGUMENTS 🫢

  • i β€” long value to subtract, like the amount getting taken off the atomic long.
  • v β€” pointer to atomic_long_t, aka the atomic long in question.

πŸ’… DESCRIPTION πŸ’…

Atomically updates v to (v - i) with full ordering. like, she’s not doing a casual little read-modify-write; she’s doing the whole atomic + fully ordered thing, periodt ✨

Safe to use in noinstr code; prefer atomic_long_sub_and_test elsewhere. that’s the manual’s vibe, not me being dramatic πŸŽ€

πŸ¦‹ RETURN πŸ¦‹

true if the resulting value of v is zero, false otherwise. literally a tiny zero-detector after the subtract, and the return value is right there waiting for you πŸ’–

🌈 SEE ALSO 🌈


mwah πŸ’‹ cute little footer moment: this page lives in ./include/linux/atomic, dated October 2026, and answers to raw_atomic_l...sub_and_test(9) in the Kernel API Manual. bye bestie, go subtract and zero-check with full-ordering energy 🫢✨

πŸ“¦ where this page comes from