poll_timeout_us_atomic(9)
π poll_timeout_us_atomic(9) β Kernel API Manual
okay bestie, welcome to the atomic polling macro page β¨ this one lives in the Kernel API Manual and it's genuinely one of those "small but mighty" situations, iykyk π«Ά
β¨ NAME β¨
poll_timeout_us_atomic β literally does what it says on the tin: it periodically polls and performs an operation until a condition is met or a timeout occurs π no cap, that's the whole gig.
π¦ SYNOPSIS π¦
poll_timeout_us_atomic (op , cond , delay_us , timeout_us ,
delay_before_op );
yes bestie, five arguments, all of them important, we do not skip a single one π
πΈ ARGUMENTS πΈ
opβ the Operation. this is the thing you actually want to do over and over until the universe cooperates β¨condβ the Break condition. the second this is true, we're out, we're done, we're going home πββοΈπ¨delay_usβ the Time toudelaybetween operations, measured in us (0means tight-looping π). and like... please read theudelayfunction description for details and limitations, fr fr, it's not optional reading πtimeout_usβ the Timeout in us. and<rainbow>0 means never timeout</rainbow>π which like, bold of you, but slay.delay_before_opβ if it is true, delaydelay_usbefore the operation π (yes, before. the vibe check happens first.)
π DESCRIPTION π
the way this macro is so iconic: it does not rely on timekeeping πβ¨ Hence it is safe to call even when timekeeping is suspended β which is huge for you atomic girlies. the trade-off? at the expense of an underestimation of wall clock time π but honestly bestie, it's rather minimal with a non-zero delay_us, so like, barely a situation.
and when available, you'll probably want to use one of the specialized macros defined below rather than this macro directly π«Ά this one is the main character, but the specialists are the whole friend group.
π RETURN π
0on success π-ETIMEDOUTupon a timeout π (it tried, it really did)
π₯ SEE ALSO π₯
go check out the Kernel file ./include/linux/iopoll.h β that's where the whole squad lives:
poll_timeout_us(9)read_poll_timeout(9)read_poll_timeout_atomic(9)readx_poll_timeout(9)readx_poll_timeout_atomic(9)
ok that's the page!! sourced from./include/linux, dated October 2026, and it's thepoll_timeout_us_atomic(9)manual page β go poll something responsibly bestie ππ§β
π¦ 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