raw_atomic_fetch_andnot(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_fetch_andnot(9) πŸ’…

okay so this is a page from the Kernel API Manual bestie, and it's about one (1) very specific little atomic helper. she's niche, she's powerful, she's raw_atomic_fetch_andnot. let's get into it πŸŽ€

✨ NAME ✨

raw_atomic_fetch_andnot β€” atomic bitwise AND NOT, but make it full ordering πŸ’…

🌸 SYNOPSIS 🌸

int raw_atomic_fetch_andnot (int i , atomic_t *v );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” an int value. that's it, that's the girl. just an int. πŸ’–
  • v β€” pointer to atomic_t. this is the one getting updated, bestie, so be nice to her.

πŸ”₯ DESCRIPTION πŸ”₯

okay so the whole vibe: this atomically updates v to (v & ~i) with full ordering. like, she does the bitwise AND NOT and keeps everybody's memory ordering in check at the same time. multitasking icon. πŸ‘‘

she's safe to use in noinstr code β€” that's her whole special talent. but everywhere else? prefer atomic_fetch_andnot. no cap, that's literally what the page says. 🫢

⭐ RETURN ⭐

the original value of v β€” like, before she did her little bitwise thing to it. she hands you the before pic and keeps the after. πŸ’€

🌈 SEE ALSO 🌈

the kernel file lives right here: ./include/linux/atomic/atomic-arch-fallback.h πŸ“

and now... the friend group. the whole entire friend group. buckle up bestie, this is a long list and every single one of them is invited to the party πŸŽ‰:


that's the whole squad, iykyk 🧚

and that's the page!! mwah πŸ’‹ she lives in ./include/linux/atomic and she's dated October 2026 β€” so she's from the future, main character energy fr fr 🌟 go forth and AND NOT responsibly bestie 🫢✨

πŸ“¦ where this page comes from