atomic64_fetch_and(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so bestie, you're looking at atomic64_fetch_and(9) β€” the Kernel API Manual page for an atomic bitwise AND with full ordering. one function, zero drama, maximum atomicity ✨


✨ SYNOPSIS ✨

s64 atomic64_fetch_and (s64 i , atomic64_t *v );

🫢 ARGUMENTS 🫢

  • i β€” an s64 value. that's the number, bestie, the one doing the ANDing.
  • v β€” pointer to atomic64_t. the actual spot in memory getting updated, front and center, main character energy πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it do? it atomically updates v to (v & i) β€” with full ordering, no cap. the whole operation lands as one indivisible little moment, and everyone else watching that value sees it happen in the correct order πŸ’–

🚩 real talk though: it's unsafe to use in noinstr code β€” use raw_atomic64_fetch_and there instead. don't be the person who ignores this, i'm begging 😭

🌸 RETURN 🌸

it hands you back the original value of v β€” the pre-glow-up version, before the AND hit it πŸŽ€


🌈 SEE ALSO 🌈

the source of all this is the kernel file ./include/linux/atomic/atomic-instrumented.h, and honestly? the family tree is huge. every single one of these is invited to the group chat πŸ’…

the atomic_* girlies

the atomic64_* besties (yes, our girl's whole family πŸ’–)

the atomic_long_* cousins 🧚


that's the whole page, bestie, and it lives in ./include/linux/atomic, dated October 2026 β€” mwah, go AND some bits safely πŸ’‹πŸ¦‹

πŸ“¦ where this page comes from