arch_set_bit(9)
πΈ 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:
__ffs(9)__fls(9)ffs(9)fls(9)arch_test_and_set_bit(9)arch_test_and_clear_bit(9)arch_test_and_change_bit(9)arch_clear_bit(9)arch_change_bit(9)arch_test_and_set_bit_lock(9)arch_clear_bit_unlock(9)arch___clear_bit_unlock(9)
byeee bestie π this page's source/version is ./arch/riscv/include/asm, dated October 2026 β mwah! π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms