Function while_eintr

Source
pub(crate) fn while_eintr<R: From<i8> + PartialEq, F: FnMut() -> R>(
    syscall: F,
) -> Result<R>
Expand description

Repeat a syscall while it returns EINTR.

Invoke the given syscall, check whether it returned an error (i.e. the integer value -1), and if so, turn it into an io::Error. If that error is EINTR, re-run the syscall, multiple times if necessary.

If no error was returned (i.e. not -1), return the returned value.