sync_test_and_set_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, we’re on the sync_test_and_set_bit(9) page of the Kernel API Manual, and the whole point is literally: set a bit and return its old value. That’s the serve. That’s the moment. πŸ’…

✨ SYNOPSIS ✨

bool sync_test_and_set_bit (long nr , volatile unsigned long *addr );

πŸŽ€ ARGUMENTS πŸŽ€

  • nr β€” the bit to set. Like, which little bit is getting the glow-up.
  • addr β€” the address to count from.

πŸ”₯ DESCRIPTION πŸ”₯

No cap: this operation is atomic and cannot be reordered. It also implies a memory barrier. That’s the whole flex, fr fr β€” do not sleep on it. 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

The kernel file ./arch/x86/include/asm/sync_bitops.h is right there, and these other icon pages are in the group chat:


Bye bestie! Signing off from the ./arch/x86/include/asm source/version corner, dated October 2026 β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from