The std::os::errno() started shouting at me that it’s deprecated. With slightly misleading warning that it should be replaced by functions from std::env which applies to most std::os but not this particular function.
The only replacement I could find is std::io::Error::last_os_error(), but it is not completely adequate, because it can only distinguish the IO-related errors. But I need values like E2BIG and EILSEQ. System-specific values are OK, because the function is system-specific too. Actually looking at the source it seems it carries the errno value along, but I see no way to get to it from the interface.
Is there any better replacement? Will the io::Error be extended or should there be another replacement?