raw_atomic_andnot(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 raw_atomic_andnot β€” the Kernel API Manual, bestie edition 🌸

Okay so we're doing raw_atomic_andnot(9) today, straight out of the Kernel API Manual πŸ’…. Yes it's a real manpage. Yes it's fancy. Let's go 🫢


✨ NAME ✨

raw_atomic_andnot β€” atomic bitwise AND NOT with relaxed ordering πŸ”₯


πŸŽ€ SYNOPSIS πŸŽ€

void raw_atomic_andnot (int i , atomic_t *v );

That's it. That's the whole call. Iconic behaviour, minimal syntax ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” an int value. That's it, that's the whole thing. It's the int value, bestie πŸ“
  • v β€” pointer to atomic_t. This is the star of the show, the main character, the thing actually getting changed πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

So like β€” atomically updates v to (v & ~i), with relaxed ordering ⭐. Read that again, no cap. It's the classic AND-NOT bitwise move, but atomic, and it's not gonna sit around waiting on memory ordering drama because, again, relaxed πŸ’…

Big thing to know: this one is safe to use in noinstr code πŸ”₯. And if you're not in noinstr code? Prefer atomic_andnot elsewhere. Like fr fr, that's the guidance β€” this is your noinstr-safe version, not your everyday grab-and-go one πŸ‘‘


🌈 RETURN 🌈

Nothing. Nada. Zero. Void. It's giving "I do the bit math and I leave" πŸ˜­πŸ’€


🌟 SEE ALSO 🌟

Okay bestie, this list is long, but I promised every single one, so here's the entire friend group 🫢✨

The kernel file itself:

  • ./include/linux/atomic/atomic-arch-fallback.h

raw_atomic_* β€” read/set fam:

add fam:

sub fam:

inc fam:

dec fam:

and / andnot fam (our people πŸ’œ):

or / xor fam:

xchg / cmpxchg fam:

test / negative fam:

unless / not_zero fam:

okay and now the whole raw_atomic64_* side of the family πŸ’€ (yes, all of them):


Lowkey that's a whole family reunion and everybody showed up πŸ’€ but we got through it together, bestie 🫢

And that's the page!! Sourced from ./include/linux/atomic, dated October 2026 β€” that's the raw_atomic_andnot(9) era, mwah πŸ’‹βœ¨ thanks for reading my whole essay, love u, bye πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from