sync_test_and_change_bit(9)
okay so bestie, this is the sync_test_and_change_bit(9) page from the Kernel API Manual, and it's giving βchange a bit, return the old valueβ main character energy π
β¨
πΈ NAME πΈ
sync_test_and_change_bit β change a bit and return its old value. Periodt. π
β¨ SYNOPSIS β¨
int sync_test_and_change_bit (long nr , volatile unsigned long *addr );
π ARGUMENTS π
nrβ the bit to change, bestie.addrβ the address to count from. Yes, thatβs the wording fr fr.
π DESCRIPTION π
okay so the actual tea: this operation is atomic and cannot be reordered. It also implies a memory barrier. Thatβs the whole lore β no cap. π¦
π SEE ALSO π
Kernel file ./arch/x86/include/asm/sync_bitops.h is the home base, and these are the other icons youβre gonna want to check:
sync_set_bit(9)sync_clear_bit(9)sync_change_bit(9)sync_test_and_set_bit(9)sync_test_and_clear_bit(9)
kisses and bit-flips, bestie π«Ά β this pageβs source/version is ./arch/x86/include/asm, dated October 2026, signing off as sync_test_and_change_bit(9) π
π¦ 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