raw_atomic_..._xor_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_..._xor_relaxed(9) β€” like, the Kernel API Manual page

okay so bestie, welcome to raw_atomic_..._xor_relaxed(9) from the Kernel API Manual β€” yes the title is literally abbreviated with dots, that's just how the man page header rolls, don't @ me. the actual function you're here for is raw_atomic_long_fetch_xor_relaxed and she is a whole mood. πŸ¦‹


✨ NAME ✨

raw_atomic_long_fetch_xor_relaxed β€” atomic bitwise XOR with relaxed ordering. it's giving "flip the bits, but make it chill." πŸŽ€


🌸 SYNOPSIS 🌸

long raw_atomic_long_fetch_xor_relaxed (long i , atomic_long_t *v );

🧚 ARGUMENTS 🧚

  • i β€” a long value. just a long. that's the whole vibe. it's the thing you're XOR-ing in. πŸ’œ
  • v β€” pointer to atomic_long_t. this is the main character β€” the atomically-updated variable herself. πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

Atomically updates v to (v ^ i) with relaxed ordering. no cap, that's literally it β€” one clean atomic XOR, lowkey elegant, highkey correct. ⭐

Safe to use in noinstr code; prefer atomic_long_fetch_xor_relaxed elsewhere. like, raw_ is the special-occasion fit you wear into noinstr territory β€” everywhere else, the regular one is the everyday slay. πŸ’…


🌈 RETURN 🌈

The original value of v. not the new one, bestie β€” the before picture. the fetch part is fetching the old value, iykyk. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/atomic/atomic-long.h β€” home of the whole atomic long family, go say hi. πŸ’–

and now the full friend group, all of them, no one left out (I would never πŸ™ˆ):

like okay that's a lot of siblings but they're all iconic in their own way, go read them, they ate. πŸ’€

and that's the page bestie!! this lil beauty lives at ./include/linux/atomic and the date stamp on her is October 2026 β€” so she's from the future, main character energy fr fr. go XOR something atomically. mwah πŸ“πŸ’œβœ¨

πŸ“¦ where this page comes from