wait_event_hrtimeout(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– wait_event_hrtimeout(9) πŸ’–

okay bestie, this page is straight out of the Kernel API Manual, and it's giving β€œgo to sleep until the vibe changes or the clock says times up” 😴✨

🌸 NAME 🌸

wait_event_hrtimeout β€” sleep until a condition gets true or a timeout elapses. no cap, that's the whole name vibe πŸ’…

✨ SYNOPSIS ✨

okay so the call is literally:

wait_event_hrtimeout (wq_head , condition , timeout );

πŸŽ€ ARGUMENTS πŸŽ€

  • wq_head β€” the waitqueue to wait on, bestie 🫢
  • condition β€” a C expression for the event to wait for. yes, a whole C expression, she's flexible ✨
  • timeout β€” timeout, as a ktime_t ⏰

πŸ¦‹ DESCRIPTION πŸ¦‹

The process is put to sleep (TASK_UNINTERRUPTIBLE) until the condition evaluates to true or a signal is received. The condition is checked each time the waitqueue wq_head is woken up. πŸ‘€

⚠️ important: wake_up has to be called after changing any variable that could change the result of the wait condition. fr fr, don't skip that part, bestie πŸ’…

The function returns 0 if condition became true, or -ETIME if the timeout elapsed. so if you get -ETIME, that's the timer girl saying β€œtime's up” β°πŸ’€

🌈 SEE ALSO 🌈

okay the whole girl gang is here β€” Kernel file ./include/linux/wait.h plus all these cuties:


alright bestie, that's the whole page! source/version: ./include/linux Β· date: October 2026 Β· page: wait_event_hrtimeout(9) β€” mwah, bye! πŸ’‹πŸŽ€βœ¨

πŸ“¦ where this page comes from