Inline function
Space | User/kernel |
Context | Sync/async/rt-irq |
May block | No |
SPL | Any |
Dynamic memory | No |
#include <ARCH/BT.H>
static __finline__ int __BTS(void *ptr, int bit);
Test a bit in a memory bitmap and then sets it. Atomicity of this operation is not specified — it should not be performed simultaneously by more threads or simultaneously by a code and an AST that interrupts it.
See the definition of __BT for description of the bitmap format in memory.
sizeof(long) * ((bit + (sizeof(long) * 8 - 1)) / sizeof(long) / 8)
bytes. 0 if the bit was clear, 1 if the bit was set.