atomic_fetch_xor(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, this is atomic_fetch_xor(9) from the Kernel API Manual, and it's giving atomic bitwise XOR with full ordering. yes, that's the whole name-and-one-liner, and it ate. πŸ’…


✨ SYNOPSIS ✨

int atomic_fetch_xor (int i , atomic_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” an int value.
  • v β€” pointer to atomic_t.

πŸ¦‹ DESCRIPTION πŸ¦‹

Atomically updates v to (v ^ i) with full ordering.

🚨 real talk: it's unsafe to use in noinstr code β€” use raw_atomic_fetch_xor there instead, bestie.

🌈 RETURN 🌈

The original value of v.


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file: ./include/linux/atomic/atomic-instrumented.h. the whole atomic squad is here, no cap:


mwah πŸ’‹ that's the whole page, bestie β€” source/version: ./include/linux/atomic, date: October 2026. now go XOR something atomically and text me after. 🫢✨

πŸ“¦ where this page comes from