The `errno` implementation was originally copied from `std`. But that was a long time ago. It's likely to have diverged from what's in `std` now. We should compare the two implementations and port any fixes over.