arch_set_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, this is arch_set_bit(9) from the Kernel API Manual, and it does exactly one iconic thing: atomically set a bit in memory. no cap. πŸ’…

πŸ› οΈ SYNOPSIS πŸ› οΈ

void arch_set_bit (int nr , volatile unsigned long *addr );

πŸŽ€ ARGUMENTS πŸŽ€

  • nr β€” the bit to set. that's the assignment, bestie ✨
  • addr β€” the address to start counting from. yes, you start counting from there 🫢

⚠️ NOTE ⚠️

real talk: on non x86 architectures, there are no guarantees that this function will not be reordered. so if you're writing portable code, make sure not to rely on its reordering guarantees. periodt. 🚨

Also, nr may be almost arbitrarily large β€” this function is not restricted to acting on a single-word quantity. it's giving flexible, lowkey unbothered, highkey powerful. 🌈

πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./arch/riscv/include/asm/bitops.h with these related besties:


byeee bestie πŸ’– this page's source/version is ./arch/riscv/include/asm, dated October 2026 β€” mwah! πŸŽ€

πŸ“¦ where this page comes from