wait_event_killable_timeout(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

Okay bestie, welcome to the Kernel API Manual page for wait_event_killable_timeout(9) β€” folded in right at the top so we can get straight to the function. The whole entire job is: wait_event_killable_timeout β€” sleep until a condition gets true or a timeout elapses. Slay.

✨ SYNOPSIS ✨

wait_event_killable_timeout (wq_head , condition , timeout );

πŸŽ€ ARGUMENTS πŸŽ€

  • wq_head β€” the waitqueue to wait on. That's your wait spot, bestie.
  • condition β€” a C expression for the event to wait for. This is the thing you're literally waiting on to get true.
  • timeout β€” timeout, in jiffies. Yep, jiffies, not seconds β€” don't come for me.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the vibe check: the process is put to sleep (TASK_KILLABLE) until the condition evaluates to true or a kill signal is received. The condition is checked each time the waitqueue wq_head is woken up.

wake_up has to be called after changing any variable that could change the result of the wait condition. That's a hard requirement, bestie β€” wake_up has to be called, periodt.

Only kill signals interrupt this process. Only kill signals β€” that's the whole guest list.

πŸ”₯ RETURN πŸ”₯

  • 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.
  • -ERESTARTSYS if it was interrupted by a kill signal.

🌈 SEE ALSO 🌈

Kernel file ./include/linux/wait.h is in the SEE ALSO squad, and the rest of the references are:

Mwah πŸ’‹ β€” source/version: ./include/linux; date: October 2026; page: wait_event_killable_timeout(9) πŸ’–

πŸ“¦ where this page comes from