https://unix.stackexchange.com/questions/509375/what-is-interrupted-system-call
loop {
let ret = uio::pwrite(self.fd, buf, offset as i64).map_err(|_| last_error!());
match ret {
Ok(nr_write) => {
trace!("write {}(offset={}) bytes to cache file", nr_write, offset);
break;
}
Err(err) => {
// Retry if the IO is interrupted by signal.
if err.kind() != ErrorKind::Interrupted {
return Err(err);
}
}
}
}
当read write返回interrupted异常后,应该重试