read_poll_timeout_atomic(9)
β¨ read_poll_timeout_atomic(9) β¨
okay bestie, so this is from the Kernel API Manual β say hi to read_poll_timeout_atomic(9) π
it's a macro that just keeps poking at an address until the vibe is right or it gives up. iconic behavior honestly.
πΈ NAME πΈ
read_poll_timeout_atomic β periodically poll an address until a condition is met or a timeout occurs π
β SYNOPSIS β
read_poll_timeout_atomic (op , val , cond , delay_us , timeout_us ,
delay_before_read , args... );
π ARGUMENTS π
opβ the accessor function, bestie. it takesargsas its arguments π«Άvalβ the variable you're reading the value intocondβ the break condition, usually involvingval. this is the "ok we can stop now" check β¨delay_usβ how long toudelaybetween reads, in us.0means tight-loops π₯ and like, please actually read theudelayfunction description for the details and limitations, i'm serious, there's lore theretimeout_usβ timeout in us.0means never timeout π (yes, forever. main character energy but make it infinite)delay_before_readβ if this is true, it delaysdelay_usbefore the read πargsβ the arguments foroppoll
π¦ DESCRIPTION π¦
so the whole moment here: this macro does not rely on timekeeping. none. zero. not a crumb. π which means it's safe to call even when timekeeping is suspended β slay β but at the expense of an underestimation of wall clock time. ngl that underestimation is rather minimal when you have a non-zero delay_us, so it's giving "fine, actually" π
and when available, you'll probably want to use one of the specialized macros defined below rather than this macro directly. like, this one is the general-purpose bestie, the specialists are the ones who actually know the assignment π
π RETURN π
0 on success, and -ETIMEDOUT upon a timeout. either way, the last read value at args is stored in val π
π§ SEE ALSO π§
Kernel file ./include/linux/iopoll.h β plus these icons: poll_timeout_us(9), poll_timeout_us_atomic(9), read_poll_timeout(9), readx_poll_timeout(9), readx_poll_timeout_atomic(9) π«
lowkey a reminder that0fortimeout_usmeans never timing out, and0fordelay_usmeans tight-looping β pick your chaos consciously, bestie π
okay that's the whole page!! this one's from ./include/linux in the October 2026 era β mwah, go poll something responsibly π
ππ
π¦ 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