wait_event_state(9)
π€ wait_event_state(9) β the "just nap till it's true" page π€
okay bestie, welcome to wait_event_state(9) from the Kernel API Manual β¨ this one's a kernel function and it's genuinely so cosy, it's giving "power nap until the vibes are correct" π
β¨ NAME β¨
wait_event_state β sleep until a condition gets true π€π¦
πΈ SYNOPSIS πΈ
wait_event_state (wq_head , condition , state );
π ARGUMENTS π
wq_headβ the waitqueue to wait on. this is your little waiting room, bestie πͺconditionβ a C expression for the event to wait for πstateβ the state to sleep in π΄
π DESCRIPTION π
The process is put to sleep (in state, obviously) until the condition evaluates to true or a signal is received β and that signal business only counts when allowed by state, okay? π«Ά The condition gets checked every single time the waitqueue wq_head is woken up. like a little vibe check on loop π
β οΈ important, no cap: wake_up has to be called after changing any variable that could change the result of the wait condition. otherwise your process is just gonna snooze forever and that's not the slay we're going for π
The function will return -ERESTARTSYS if it was interrupted by a signal (again β when allowed by state), and 0 if condition evaluated to true π
π₯ SEE ALSO π₯
the whole waitqueue friend group π«Ά and yes, they're all in the kernel file ./include/linux/wait.h:
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(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_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)
that's the whole page, bestie β go take a nap until your condition is true, you've earned it π΄π
β§ο½₯οΎ signed, sealed, delivered from ./include/linux, dated October 2026, wait_event_state(9) ο½₯οΎβ§
π¦ 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