raw_atomic64_fetch_and(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic64_fetch_and β€” Kernel API Manual

okay so bestie, welcome to section 9 of the Kernel API Manual β€” you're here for raw_atomic64_fetch_and(9) and honestly? she's a baddie. tiny page, huge energy. let's get into it 🫢


🌸 NAME 🌸

raw_atomic64_fetch_and β€” atomic bitwise AND with full ordering

like, she does a bitwise AND and she does it atomically and she does it with full ordering. triple threat. main character energy fr πŸ’…


✨ SYNOPSIS ✨

s64 raw_atomic64_fetch_and (s64 i , atomic64_t *v );

that's it. that's the whole vibe check. two arguments, one s64 back. slay.


πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” an s64 value. yes, that's the whole description. she's a value. that's her job. it's giving minimalism ✨
  • v β€” pointer to atomic64_t. this is the girl getting ANDed. she's a pointer, so like, handle with care πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

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

no cap β€” the whole operation is one atomic little moment. nobody sees the in-between. it's giving ✨seamless✨. and the full ordering part? that means she's not being casual about memory ordering, she's being serious about it. full ordering, periodt πŸ”₯

Safe to use in noinstr code; prefer atomic64_fetch_and elsewhere.

so like β€” noinstr code is the super-strict zone, and she's allowed in there, which is iconic of her. but if you're not in noinstr code? use atomic64_fetch_and instead. she's telling you herself. listen to her πŸ™ˆ


πŸ‘‘ RETURN πŸ‘‘

The original value of v.

not the new one, bestie β€” the original. the before picture πŸ“Έ. she hands you what v was prior to the AND, so you can go be nosy about it. iykyk πŸ’œ


🌈 SEE ALSO 🌈

okay this list is long long. like, genuinely. but every single one of these is here for a reason so we're doing all of them. no skipping. hydration and completeness πŸ’§

Kernel file ./include/linux/atomic/atomic-arch-fallback.h

πŸ“ the 32-bit girlies β€” read & set

πŸ“ add family

πŸ“ sub family

πŸ“ inc family

πŸ“ dec family

πŸ“ and / andnot

πŸ“ or / xor

πŸ“ exchange & compare-exchange

πŸ“ the test-y ones


🧚 and now the 64-bit girlies (that's our household)

πŸ’œ read & set

πŸ’œ add family

πŸ’œ sub family

πŸ’œ inc family

πŸ’œ dec family

πŸ’œ and / andnot

πŸ’œ or / xor

πŸ’œ exchange & compare-exchange

πŸ’œ the test-y ones


bestie if you read that whole list you deserve a little treat πŸ“ go drink some water, and remember: noinstr is the only place she needs to be the raw one πŸ’–

okay that's the page!! she lives in ./include/linux/atomic, she's dated October 2026, and she's signing off as raw_atomic64_fetch_and(9) β€” mwah, go AND something atomically, you got this πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from