wait_on_bit_timeout(9)
π€ wait_on_bit_timeout(9)
okay so this is a page from the Kernel API Manual β the wait_on_bit_timeout(9) one, and honestly bestie, it's lowkey the chillest function in the whole wait_bit family. Let's get into it β¨
πΈ NAME πΈ
wait_on_bit_timeout β wait for a bit to be cleared or a timeout to elapse. whichever comes first, no cap π
β¨ SYNOPSIS β¨
int wait_on_bit_timeout (unsigned long *word , int bit , unsigned mode ,
unsigned long timeout );
π ARGUMENTS π
wordβ the address containing the bit we're waiting on. like, the actual home of the bit πbitβ the specific bit at that address that's being waited onmodeβ the task state to sleep in π΄timeoutβ the timeout, measured in jiffies β³
π¦ DESCRIPTION π¦
So the whole vibe is: wait for the given bit in an unsigned long or a bitmap (peep DECLARE_BITMAP) to get cleared, or wait for a timeout to expire. Whichever happens first. π«Ά
Heads up though β the clearing of the bit must be signalled withwake_up_bit, and a lot of the time that'sclear_and_wake_up_bit. If nobody signals, we're just out here waiting. π
This one is similar to wait_on_bit, except it also takes a timeout parameter. That's the whole personality trait, honestly. β
The returned value is:
- zero if the bit was cleared β and in that case the call has ACQUIRE semantics π
-EINTRif the process received a signal and themodepermitted wake up on that signal π-EAGAINif the timeout elapsed π
π SEE ALSO π
Kernel file ./include/linux/wait_bit.h, plus the whole friend group fr fr:
wait_on_bit(9)wait_on_bit_io(9)wait_on_bit_action(9)wait_on_bit_lock(9)wait_on_bit_lock_io(9)wait_on_bit_lock_action(9)wait_var_event(9)wait_var_event_io(9)wait_var_event_killable(9)wait_var_event_timeout(9)wait_var_event_interruptible(9)wait_var_event_any_lock(9)wait_var_event_spinlock(9)wait_var_event_mutex(9)wake_up_var_protected(9)wake_up_var_locked(9)clear_and_wake_up_bit(9)test_and_clear_wake_up_bit(9)atomic_dec_and_wake_up(9)store_release_wake_up(9)
that's the whole page bestie, ily, go clear some bits πβ¨ππ¦
shoutout to ./include/linux and the October 2026 drop β this one's sourced straight from there, mwah π
π¦ 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