raw_atomic_long_fetch_and(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_long_fetch_and β€” Kernel API Manual ✨

okay so bestie, we're in the Kernel API Manual today and this one is a lil baddie from the atomic family, no cap 🫢


🌸 NAME 🌸

raw_atomic_long_fetch_and β€” atomic bitwise AND with full ordering πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

long raw_atomic_long_fetch_and (long i , atomic_long_t *v );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” a long value, that's it, that's the whole vibe
  • v β€” pointer to atomic_long_t, the main character of this whole operation πŸ‘‘

⭐ DESCRIPTION ⭐

So like, atomically updates v to (v & i) with full ordering. it's giving "bitwise AND but make it safe under concurrency" πŸ’…

it is safe to use in noinstr code β€” literally built different. but outside of that, prefer atomic_long_fetch_and β€” that's the general-fave icon, raw_ is the special-occasion one ✨


πŸ’œ RETURN πŸ’œ

The original value of v β€” yes, before the AND happened. she gives you the receipts from before the glow-up πŸ˜­πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

the kernel file lives at ./include/linux/atomic/atomic-long.h β€” go say hi to the source bestie 🧚

and here's the whole friend group, all of them, i'm not doing anyone dirty by skipping them πŸ’€:


and that's the whole page bestie, go AND some bits πŸ’…βœ¨

this lil masterpiece comes to you from ./include/linux/atomic, dated October 2026 β€” and the page itself is raw_atomic_long_fetch_and(9) πŸŽ€ iykyk 🫢

πŸ“¦ where this page comes from