Is there a policy for handling io::ErrorKind::Interrupted in libstd?
From what I can see, most (all?) nontrivial functions just ignore it and retry.
That’s a bit unfortunate.
I find myself reimplementing half of std::io just to be able to interrupt those calls.
IMO the policy should be one of the following:
- Remove io::ErrorKind::Interrupted alltogether. (Even for
read and write)
- (Preferred) Break on io::ErrorKind::Interrupted if possible. (Meaning if the function can be retried safely)
The current state is a bit pointless. The error is there and has to be considered, but it’s still not really usable for those who need it.
EDIT: An example of a function that could be retried safely is io::Read::read_to_end(...)