It makes sense to use the errnos() returned by the underlying OS...However on windows we get several mysterious errors. For example we get back errno 3 (ESRCH) for File::Stat.new "" instead of 2 (ENOENT). We also seem to sometimes get 20047 for stat'ing 'file:' which I suspect hits some magic windows remote server magic.
We can elect to fix this in either JRuby or in jnr-posix. I would vote for JRuby since jnr-posix maybe should only pass what the OS wants to tell us...OTOH..it really sucks to catch different types of RaiseExceptions in any place where we call any of the stats. This only affects master so we have some time to chew on this, but it is a major blocker to getting Windows CI green again.