atomic_cmpxchg(9)
β¨ atomic_cmpxchg(9) β Kernel API Manual β¨
okay so bestie, welcome to the atomic_cmpxchg(9) page from the Kernel API Manual π
this one is literally about an atomic compare and exchange, and weβre gonna keep every single deet. no cap.
πΈ NAME πΈ
atomic_cmpxchg β Atomic compare and exchange
π¦ SYNOPSIS π¦
int atomic_cmpxchg (atomic_t *addr , int oldval , int newval );
π ARGUMENTS π
addrβ-- undescribed --π the manpage is literally not giving us anything else for this one, so thatβs the whole description we got.oldvalβ the expected value of the futex β¨newvalβ the new value to try and assign the futex π«Ά
π DESCRIPTION π
Return the old value of addr->val. periodt π
thatβs the description, short and iconic.
π₯ SEE ALSO π₯
- Kernel file
./tools/testing/selftests/futex/include/atomic.h atomic_inc(9),atomic_dec(9),atomic_set(9)
mwah π this cutie comes from source/version ./tools/testing/selftests/fute..., dated October 2026, page atomic_cmpxchg(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