wait_for_co...ible_timeout(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so bestie, welcome to wait_for_completion_interruptible_timeout β€” manual section 9, Kernel API Manual, the whole vibe. she waits for completion (w/(to,intr)), and yes that abbreviation is literally just her being extra. πŸŽ€


✨ SYNOPSIS ✨

long wait_for_completion_interruptible_timeout (struct completion *x ,
       unsigned long timeout );

like, that's the whole signature. two args, one long coming back at you. πŸ’–


🫢 ARGUMENTS 🫢

  • x β€” holds the state of this particular completion. she's the main character, she keeps the receipts. πŸ‘‘
  • timeout β€” timeout value in jiffies. yes, jiffies. not seconds, not ms, jiffies. iykyk. ⏳

🌸 DESCRIPTION 🌸

so what she does is: she waits for either a completion of a specific task to be signaled, or for a specified timeout to expire. whichever comes first, she's out. it's giving "i'll wait but not forever" energy. πŸ’…

and the key thing β€” she is interruptible. so if a signal shows up, she's not gonna just stand there. she dips. πŸ¦‹

the timeout is in jiffies. fr fr, jiffies. don't @ me with milliseconds. 🌈


⭐ RETURN ⭐

here's the vibe check on what she hands back, and there are exactly three moods:

  • -ERESTARTSYS β€” if interrupted. someone signaled, she's out. 😭
  • 0 β€” if timed out. she waited the whole time and nothing happened. πŸ’€
  • positive β€” if completed! at least 1, or the number of jiffies left till timeout. so like, a positive number means we ate. πŸ”₯
ngl, the positive return being "jiffies left till timeout" is such a cute little bonus detail, don't sleep on it. ✨

🧚 SEE ALSO 🧚

kernel file ./kernel/sched/completion.c β€” that's where the magic lives, bestie:

like she has a whole friend group and every single one of them is iconic in her own way. go say hi. 🫢🌸


and that's the page, pookies β€” brought to you from ./kernel/sched, dated October 2026, and filed under wait_for_co...ible_timeout(9) because even the header got truncated and honestly? relatable. πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from