atomic_long_sub_and_test(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ atomic_long_sub_and_test(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual entry for atomic_long_sub_and_test(9). This is the atomic-subtract-and-check-if-you-hit-zero situation, and yes, it has full ordering. We love a function with commitment. πŸ’…


✨ NAME ✨

atomic_long_sub_and_test β€” atomic subtract and test if zero with full ordering.

🌸 SYNOPSIS 🌸

bool atomic_long_sub_and_test (long i , atomic_long_t *v );

🧚 ARGUMENTS 🧚

  • i β€” the long value you're subtracting. This is the amount getting taken away, okay?
  • v β€” pointer to atomic_long_t. This is the atomic long getting updated. Main character energy fr.

πŸ”₯ DESCRIPTION πŸ”₯

Atomically updates v to (v - i) with full ordering. So the subtraction happens as one atomic little moment, and the ordering is the full kind β€” not relaxed, not playing games. ✨

⚠️ Unsafe to use in noinstr code; use raw_atomic_long_sub_and_test there instead. Like, do not ignore that one, bestie. 🫢

πŸ’– RETURN πŸ’–

true if the resulting value of v is zero, false otherwise. That's the whole test part, and it ate. πŸ‘‘

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/atomic/atomic-instrumented.h β€” plus the whole bestie squad:


okay that's the whole page, bestie. πŸ’– source/version/date check: ./include/linux/atomic, October 2026, atomic_long_sub_and_test(9). stay atomic, stay iconic. πŸ¦‹βœ¨

πŸ“¦ where this page comes from