test_and_change_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 🌈


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