wait_event_interruptible(9)
π wait_event_interruptible β the kernel API manual, bestie edition π
okay so real talk, this page is wait_event_interruptible(9) from the Kernel API Manual (section 9, iykyk) β and it's literally the "go to sleep but wake up if someone pokes you" function. let's get into it π«Ά
β¨ NAME β¨
wait_event_interruptible β sleep until a condition gets true π΄β‘οΈβ
πΈ SYNOPSIS πΈ
wait_event_interruptible (wq_head , condition );
π ARGUMENTS π
wq_headβ the waitqueue you're gonna wait on. that's the spot you're camping out at, babe βΊconditionβ a C expression for the event you're waiting for. the "am I awake yet?" check π
π¦ DESCRIPTION π¦
so the process gets put to sleep β specifically in TASK_INTERRUPTIBLE state β until either the condition evaluates to true β¨ or a signal shows up π¬. and the condition gets checked every single time the waitqueue wq_head is woken up. every time. no cap.
the important bit, do not skip this:wake_uphas to be called after changing any variable that could change the result of the wait condition. like, you change the thing, you callwake_up. that's the deal. fr fr π₯
the function returns -ERESTARTSYS if it got interrupted by a signal π, and 0 if condition evaluated to true π.
π SEE ALSO π
kernel file ./include/linux/wait.h, plus the whole friend group:
waitqueue_active(9)wq_has_single_sleeper(9)wq_has_sleeper(9)wake_up_pollfree(9)wait_event(9)wait_event_freezable(9)wait_event_timeout(9)wait_event_cmd(9)wait_event_interruptible_timeout(9)wait_event_hrtimeout(9)wait_event_interruptible_hrtimeout(9)wait_event_idle(9)wait_event_idle_exclusive(9)wait_event_idle_timeout(9)wait_event_idle_exclusive_timeout(9)wait_event_interruptible_locked(9)wait_event_interruptible_locked_irq(9)wait_event_interruptible_exclusive_locked(9)wait_event_interruptible_exclusive_locked_irq(9)wait_event_killable(9)wait_event_state(9)wait_event_killable_timeout(9)wait_event_lock_irq_cmd(9)wait_event_lock_irq(9)wait_event_interruptible_lock_irq_cmd(9)wait_event_interruptible_lock_irq(9)wait_event_interruptible_lock_irq_timeout(9)
and that's the whole page, bestie β brought to you straight out of ./include/linux, dated October 2026, slaying as always ππ periodt.
π¦ 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