read_poll_timeout(9)
π read_poll_timeout(9) π
okay so bestie, welcome to the kernel API manual β this is read_poll_timeout, and honestly? it's giving "just keep checking until it works" energy. she periodically polls an address until a condition is met or a timeout occurs. iconic behavior, no cap. π
β¨ SYNOPSIS β¨
read_poll_timeout (op , val , cond , sleep_us , timeout_us ,
sleep_before_read , args... );
that's the whole vibe right there. six named things plus a lil args... situation. slay. π¦
πΈ ARGUMENTS πΈ
opβ the accessor function. she's the main character here, and she takesargsas her arguments. iykyk.valβ the variable you're reading the value into. the lil home for your result. πcondβ the break condition, aka the "we're so done here" check. usually involvesval, because of course it does.sleep_usβ maximum time to sleep between reads, in us. and yes,0means tight-loops β literally just going feral in a loop, no rest. please read theusleep_rangefunction description for the details and limitations, bestie, i'm begging you. πtimeout_usβ timeout in us.0means never timeout β she waits forever, patient queen. πsleep_before_readβ if it's true, sleep forsleep_usbefore the read. like a lil nap before the vibe check. π΄argsβ the arguments foroppoll. they get passed straight through. π«Ά
π DESCRIPTION π
so, when it's available, you'll probably want to use one of the specialized macros defined below rather than this macro directly. like, not me telling you what to do, butβ¦ i'm telling you what to do. π
β RETURN β
0 on success and -ETIMEDOUT upon a timeout. either way, the last read value at args is stored in val β so you always get the receipt. π§Ύ
π¨ warning, bestie, lowkey important: must not be called from atomic context ifsleep_usortimeout_usare used. fr fr. do not do that. π
π SEE ALSO π
- Kernel file
./include/linux/iopoll.h poll_timeout_us(9)poll_timeout_us_atomic(9)read_poll_timeout_atomic(9)readx_poll_timeout(9)readx_poll_timeout_atomic(9)
go read those too, they're literally the family. π«Άβ¨
and that's the page, bestie! π this one lives under ./include/linux and the date on it is October 2026 β so yeah, straight from the kernel API manual, dated in the future like the icon she is. mwah. ππ§ββοΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms