Function poll

Source
pub fn poll(reqs: &mut [PollRequest<'_>], timeout: int) -> Result<int>
Expand description

poll wraps the Linux system call of the same name, or at least one with a similar name, passing all of the given requests to the kernel.

Warning: This abstraction doesn’t really work because the lifetime bounds on PollRequest make the File objects unusable once the are used here with a mutable borrow. We’ll hopefully fix this in a future release.

The kernel will modify the request objects in-place with updated event flags, which you can then retrieve using PollRequest::response. The successful return value is the number of entries in reqs that now have at least one response flag set.

The kernel may have an upper limit on the number of entries in reqs that is smaller than the maximum value of usize. If the given slice is too long then this function will return the EINVAL error code.