When stdio was added, cc65's errno behavior was inherited. Errors are sent through __mappederrno by the standard library. But why?
Modern C uses a macro that calls a function for errno. If we did this, all the error checking in the standard library can be skipped and apps that don't look at errno won't link in all the code and translation tables.
Also, __oserror should be a platform defined macro too if this is changed. Some platforms, like the RP6502, would then get this feature for 0 code and 0 data.