wait_on_bit_io(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ 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 with wake_up_bit, and a lot of the time that's via clear_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:


πŸ’– 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