Rather than a new function here, the `error` module should expose an `error_for_errno` function (which `error_for_oserror` can use).