wait_event_i...ible_timeout(9)
π€ wait_event_i...ible_timeout(9) β the Kernel API Manual tea, bestie β¨
Okay so real talk, the page header literally says wait_event_i...ible_timeout(9) from the Kernel API Manual, and that's our whole main character for today. Buckle up, we're going to sleep (but like, interruptibly π
).
πΈ NAME πΈ
wait_event_interruptible_timeout β she sleeps until a condition gets true or a timeout elapses. Whichever comes first, queen behavior fr fr.
β¨ SYNOPSIS β¨
wait_event_interruptible_timeout (wq_head , condition , timeout );
π ARGUMENTS π
wq_headβ the waitqueue to wait on. Like, this is the group chat you're lurking in πconditionβ a C expression for the event to wait for. The "am I unblocked yet?" vibe check β¨timeoutβ timeout, in jiffies. Yes bestie, jiffies. Not seconds. Not vibes. Jiffies π°οΈ
π¦ DESCRIPTION π¦
So what actually happens: the process gets put to sleep β and ngl, she's in TASK_INTERRUPTIBLE mode, which is the fancy way of saying "asleep but still answering texts" β until the condition evaluates to true or a signal is received π
The condition gets checked each and every time the waitqueue wq_head is woken up. Every single time. Not me refreshing the timeline π±
β οΈ Warning bestie, this one matters: wake_up has to be called after changing any variable that could change the result of the wait condition. Skip that and you're literally ghosting your own waitqueue π
π₯ RETURN π₯
Here's the receipts, and yes, every single one:
0β if the condition evaluated to false after the timeout elapsed π«1β if the condition evaluated to true after the timeout elapsed π- the remaining jiffies (at least 1) β if the condition evaluated to true before the timeout elapsed β³ (and yes, at least
1, they said what they said) -ERESTARTSYSβ if it was interrupted by a signal π rude but okay
π SEE ALSO π
Kernel file ./include/linux/wait.h, and literally the entire waitqueue friend group β slay:
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_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)
Okay that's the whole page bestie, no cap, nothing skipped π This icon lives at ./include/linux, dated October 2026, and its manual tag is forever wait_event_i...ible_timeout(9) β 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