wait_on_bit_io(9)
π€ wait_on_bit_io(9) π€
okay so this is a page from the Kernel API Manual β yes we're in kernel-land today bestie, buckle up π
β¨ NAME β¨
wait_on_bit_io β the "please wait for this bit to get cleared" girlie π
πΈ SYNOPSIS πΈ
int wait_on_bit_io (unsigned long *word , int bit , unsigned mode );
literally the whole signature, no cap β¨
π¦ ARGUMENTS π¦
wordβ the address that's holding the bit you're waiting on. like, the actual location, not a copy π«Άbitβ the specific bit at that address that you're sitting around waiting on πmodeβ the task state you wanna sleep in while you wait π΄
π DESCRIPTION π
So here's the vibe: you're waiting for a given bit β in an unsigned long or a bitmap (peep DECLARE_BITMAP π) β to get cleared. That's the whole mission.
important!! whoever clears that bit has got to signal it withwake_up_bit, and a lot of the time that's viaclear_and_wake_up_bit. no signal = you're just gonna sit there, and not in a cute way π
This one is basically wait_on_bit's sibling, but with a glow-up: it calls io_schedule instead of schedule for the actual waiting part. same energy, different scheduler, iykyk π
As for what you get back β the return value is zero if the bit got cleared, and in that case the call has ACQUIRE semantics π₯. Or you get -EINTR if the process caught a signal and the mode you passed actually permitted waking up on that signal. slay, but also watch out π
π SEE ALSO π
okay this list is long and honestly iconic, here's the whole friend group π«Ά it all lives in the kernel file ./include/linux/wait_bit.h:
wait_on_bit(9)wait_on_bit_timeout(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)
π and that's the page!! this lil beauty ships out of ./include/linux, dated October 2026 β go forth and wait on your bits responsibly bestie, 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