[PATCH] newlib: Simplify errno access
Corinna Vinschen
vinschen@redhat.com
Wed Nov 19 15:43:33 GMT 2025
Hi Paul,
On Aug 30 21:19, Paul Cercueil wrote:
> I see no reason why every single errno access (read or write) should
> trigger a function call to just return an offset into the reent struct.
>
> This seems to have been needed in the past, but it does not seem to be
> needed anymore.
>
> Drop the __errno() function, and set the 'errno' macro to point to the
> corresponding offset into the _reent struct.
You can't do that unconditionally. The __errno function is exported
from the Cygwin DLL and actually used by applications. So the __errno
function must exist and return a useful value for backward compat, even
if it's not used by newly compiled code.
Thanks,
Corinna
More information about the Newlib
mailing list