expression
Understand poll readiness counts
poll examines a supplied descriptor list. Its successful result counts entries with nonzero returned event masks, not bytes or individual flags. Zero means no event was reported during the wait. This Rust model counts synthetic returned masks; it does not invoke poll. The separate Linux C lab calls the real API. Expected stdout (not executed): ready entries: 2 Common mistake: Treating a readiness count as a byte count. Run only in the isolated fixture runner, not a public code playground.
Formal Syntax & Structure
rust syntaxrust
poll(fds, nfds, timeout_ms) (C API)Working Example
Example Snippetrust
fn main() { let returned_masks = [0u16, 1, 5, 0]; let ready = returned_masks.iter().filter(|&&mask| mask != 0).count(); println!("ready entries: {ready}");}