wait_event_killable(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ wait_event_killable(9) πŸ’€

okay bestie, welcome to the Kernel API Manual entry for wait_event_killable(9) β€” this one is lowkey iconic and very β€œsleep until the vibe changes” πŸ’…


✨ NAME ✨

wait_event_killable β€” sleep until a condition gets true. fr fr, that’s the whole name vibe 🫢


πŸ’€ SYNOPSIS πŸ’€

okay so here’s the exact shape of it, no cap:

wait_event_killable (wq_head , condition );

πŸŽ€ ARGUMENTS πŸŽ€

  • wq_head β€” the waitqueue to wait on. that’s the spot you’re chilling at πŸ›‹οΈ
  • condition β€” a C expression for the event to wait for. the thing your whole personality is waiting on ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

The process is put to sleep (TASK_KILLABLE) until the condition evaluates to true or a signal is received. Periodt. Every single time the waitqueue wq_head is woken up, the condition gets checked again πŸ‘€

wake_up has to be called after changing any variable that could change the result of the wait condition. not me reminding you again, but like… yes, you actually have to do it πŸ’€

⚠️ reminder bestie: wake_up has to be called after changing any variable that could change the result of the wait condition. do not skip this step, i’m begging πŸ™

The function will return -ERESTARTSYS if it was interrupted by a signal and 0 if condition evaluated to true. that’s the whole return vibe 🌈


🌈 SEE ALSO 🌈

Kernel file ./include/linux/wait.h plus the entire squad: 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_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) 🫢✨


xoxo bestie, from the ./include/linux source, version wait_event_killable(9), dated October 2026 β€” this page is signing off πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from