atomic_long_...h_or_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic_long_fetch_or_acquire(9)

okay so bestie, this is a page straight out of the Kernel API Manual and it's short but she is mighty β€” it's the whole vibe of "OR a long, atomically, with acquire ordering, and hand me back what was there before." iconic behaviour honestly. 🫢


🌸 NAME

atomic_long_fetch_or_acquire β€” atomic bitwise OR with acquire ordering ✨

✨ SYNOPSIS

long atomic_long_fetch_or_acquire (long i , atomic_long_t *v );

πŸŽ€ ARGUMENTS

  • i β€” a long value. literally just a long, no drama. it's the thing getting OR'd in.
  • v β€” pointer to atomic_long_t. this is the atomic long bestie that's actually getting updated, so pls pass a real pointer, not a vibe. πŸ™ˆ

πŸ”₯ DESCRIPTION

So the way this works: she atomically updates v to (v | i) with acquire ordering. atomic. one clean operation, no half-states, no "oops another thread saw a weird in-between value" situation. πŸ’…

⚠️ danger zone, no cap: this one is unsafe to use in noinstr code. If you're in noinstr territory, use raw_atomic_long_fetch_or_acquire there instead. do not skip this, fr fr, that's the whole point of the raw_ variant existing. 😭

πŸ‘‘ RETURN

The original value of v β€” i.e. the value before the OR landed. she hands you the receipts of what was there first. πŸ’–

πŸ¦‹ SEE ALSO

kernel file: ./include/linux/atomic/atomic-instrumented.h

okay this next part is a lot of names but every single one of them matters, so I'm not skipping a single one β€” group-chat style, family by family. πŸ’œ


and that's the page, bestie β€” go forth and OR things atomically πŸ’…βœ¨

sign-off szn: this lovely little page lives at ./include/linux/atomic, dated October 2026. mwah, take care of her πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from