readx_poll_timeout(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… readx_poll_timeout πŸ’…

okay so this is a Kernel API Manual page, and bestie, it's literally about polling an address over and over until a condition hits or you run out of time. no cap. ⏰


✨ NAME ✨

readx_poll_timeout β€” periodically poll an address until a condition is met or a timeout occurs πŸŽ€


🌸 SYNOPSIS 🌸

readx_poll_timeout (op , addr , val , cond , sleep_us , timeout_us );

like, yes, that's the whole thing. six args. she's iconic. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • op β€” the accessor function, aka the little guy who does the actual reading (it takes addr as its only argument, that's the whole vibe)
  • addr β€” the address you're polling, the main character of this whole operation πŸ‘‘
  • val β€” the variable where the value gets read into 🫢
  • cond β€” the break condition, the thing you're waiting for (usually involves val, iykyk)
  • sleep_us β€” max time to sleep between reads, in us. and yes, 0 means tight-loops 😭 please go read the usleep_range function description for the details and limitations, fr fr, don't skip it
  • timeout_us β€” the timeout, in us. 0 means never timeout, so like... she'll wait forever, no thoughts head empty πŸ’€

🧚 DESCRIPTION 🧚

so bestie, when it's available, you'll probably want to use one of the specialized macros defined below instead of this macro directly. that's the whole tea. β˜•βœ¨


⭐ RETURN ⭐

0 on success, and -ETIMEDOUT when the timeout hits. either way, the last read value at addr gets stored in val, so you're never left hanging with nothing. πŸ’–

lowkey important warning: this must not be called from atomic context if sleep_us or timeout_us are used. like, do not do that. πŸ™ˆ

🌈 SEE ALSO 🌈


and that's the page, bestie! this one lives in ./include/linux, dated October 2026 β€” so mark your calendars, the kernel API manual is booked and busy. πŸŽ€πŸ’œβœ¨

πŸ“¦ where this page comes from