test_and_change_bit(9)
β¨ NAME β¨
okay so bestie, welcome to the Kernel API Manual β this is test_and_change_bit(9) π
test_and_change_bit β Change a bit and return its old value. literally the βglow up the bit, then tell you what it was beforeβ of bit ops β¨
π¦ SYNOPSIS π¦
bool test_and_change_bit (long nr , volatile unsigned long *addr );
π ARGUMENTS π
nrβ Bit to change π«Άaddrβ Address to count from. yes, thatβs the official wording, iykyk π
π₯ DESCRIPTION π₯
This is an atomic fully-ordered operation (implied full memory barrier). periodt. Itβs giving serious synchronization energy, so treat it with main-character respect π
β¨
π SEE ALSO π
- Kernel file
./include/asm-generic/bitops/instrumented-atomic.hπ§ set_bit(9)clear_bit(9)change_bit(9)test_and_set_bit(9)test_and_clear_bit(9)
okay thatβs the whole page, bestie π«Ά this cutie comes from the ./include/asm-generic/bitops source/version, dated October 2026, and itβs filed under test_and_change_bit(9). slay π
π¦ 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