wait_event_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ 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:


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