atomic_long_xor(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ atomic_long_xor ✨

okay so bestie, welcome to the Kernel API Manual page for atomic_long_xor(9) β€” the tiny function that flips bits on a long atomically and keeps the ordering relaxed 😌. Let's get into it, no cap.


πŸŽ€ NAME πŸŽ€

atomic_long_xor β€” atomic bitwise XOR with relaxed ordering

πŸ¦‹ SYNOPSIS πŸ¦‹

void atomic_long_xor (long i , atomic_long_t *v );

🌸 ARGUMENTS 🌸

  • i β€” a long value. Like, just a long. That's the whole description, bestie 🫢.
  • v β€” pointer to atomic_long_t. It's a pointer to the atomic thing you're about to XOR, iykyk.

πŸ’œ DESCRIPTION πŸ’œ

Atomically updates v to (v ^ i) with relaxed ordering. That's it, that's the vibe β€” the whole update lands atomically, and the ordering is relaxed πŸ”₯.

⚠️ Warning, and this one matters: it is unsafe to use in noinstr code β€” use raw_atomic_long_xor there instead. Not me being dramatic, that's literally what the docs say πŸ’€.

⭐ RETURN ⭐

Nothing. Not zero, not a bool, not a little gift β€” the signature is void, so genuinely nothing comes back πŸ’….

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file: ./include/linux/atomic/atomic-instrumented.h πŸ¦‹

Here's the whole squad, in order, and yes I'm listing every single one because we don't do half-finished here 🌈:

the atomic_ crew πŸ’–

the atomic64_ crew πŸ’œ

the atomic_long_ crew (our main characters, fr fr) πŸ‘‘


and that's the page, bestie 🫢 β€” sourced from ./include/linux/atomic, dated October 2026, filed under atomic_long_xor(9). slay, go flip some bits πŸ’…βœ¨

πŸ“¦ where this page comes from