raw_atomic_long_fetch_xor(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ raw_atomic_long_fetch_xor(9) β€” Kernel API Manual πŸ¦‹

🌸 NAME 🌸

raw_atomic_long_fetch_xor is literally the atomic bitwise XOR with full ordering bestie. No cap, this is the one. πŸ’…

✨ SYNOPSIS ✨

long raw_atomic_long_fetch_xor (long i , atomic_long_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” a long value. That's the first argument, bestie.
  • v β€” pointer to atomic_long_t. That's the atomic long you're working with.

πŸ’– DESCRIPTION πŸ’–

Okay so the actual tea: this function atomically updates v to (v ^ i) with full ordering. That's the whole vibe. ✨

It's safe to use in noinstr code, which is giving special-purpose main character energy. Everywhere else, the page says prefer atomic_long_fetch_xor β€” so keep this raw one for the noinstr moments and let atomic_long_fetch_xor handle the rest. 🫢

πŸ‘‘ RETURN πŸ‘‘

The original value of v β€” the pre-XOR one. You get the original, not the updated value. πŸ’…

🌈 SEE ALSO 🌈

Kernel file first, because the source is the moment:

  • ./include/linux/atomic/atomic-long.h

And the whole raw_atomic_long_* family β€” every single one is here, no skips, no crumbs:

πŸ“– read + set

βž• add squad

βž– sub squad

πŸ” inc + dec squad

🧚 bitwise besties

πŸ”„ xchg + cmpxchg crew

πŸ“ tests + specials


That's the whole page, bestie! 🫢 Source/version is ./include/linux/atomic, date is October 2026, and the manual page is raw_atomic_long_fetch_xor(9) from the Kernel API Manual. Stay slaying those atomics. πŸ’…βœ¨

πŸ“¦ where this page comes from