atomic64_fetch_and_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic64_fetch_and_relaxed πŸ’…

okay so bestie, welcome to the Kernel API Manual, section 9 β€” this is the page for atomic64_fetch_and_relaxed and it's honestly kind of iconic. it's a tiny little atomic op that does a bitwise AND but also hands you back the old value like a lil souvenir. let's get into it 🫢


🌸 NAME 🌸

atomic64_fetch_and_relaxed β€” atomic bitwise AND with relaxed ordering

like yes, she's ANDing, and yes, she's relaxed about the ordering. main character energy fr.


πŸ¦‹ SYNOPSIS πŸ¦‹

s64 atomic64_fetch_and_relaxed (s64 i , atomic64_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” an s64 value. that's the thing you're ANDing in πŸ’–
  • v β€” pointer to atomic64_t. this is the atomic thing that's gonna get updated, she's the target of the whole operation ✨

πŸ’œ DESCRIPTION πŸ’œ

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

that's it, that's the whole vibe β€” one atomic AND, chill ordering, done. slay.

⚠️ okay real talk though bestie, this one is unsafe to use in noinstr code β€” if you're in there, use raw_atomic64_fetch_and_relaxed instead. no cap, don't ignore this one 😭

πŸ”₯ RETURN πŸ”₯

The original value of v. like, the value before the AND happened β€” she gives you the receipts πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/atomic/atomic-instrumented.h β€” and honestly the whole atomic family is here, so buckle up bestie, we're listing every single one 🌈

πŸ“ the plain atomic_* crew

🧚 the atomic64_* crew

🌈 the atomic_long_* crew


and that's the whole page bestie, ily, go AND some 64-bit values atomically πŸ’–βœ¨

this cutie lives in ./include/linux/atomic, dated October 2026, and it's filed under atomic64_fetch_and_relaxed(9) β€” mwah, periodt πŸŽ€

πŸ“¦ where this page comes from