strerror_r questions

Eric Blake
Thu Feb 10 00:43:00 GMT 2011

On 02/09/2011 05:17 PM, Eric Blake wrote:
> Changes in v2: more documentation, fix the signature, change the default
> when no feature macros are defined, don't overwrite buf if n is too
> small, guarantee NUL termination in POSIX variant

Shoot - I missed another POSIX requirement:

"The implementation shall behave as if no function defined in this
volume of POSIX.1-2008 calls strerror( )."

That is, strerror_r() cannot call strerror() (but we _can_ have a helper
method that both strerror() and strerror_r() call).

The POSIX requirement means that someone can replace strerror() with
their own link, but doing so won't affect the behavior of strerror_r().
 Is this something that I should worry about and clean up in a followup
patch?  Or is it too much of a corner case to bother with?

Eric Blake    +1-801-349-2682
Libvirt virtualization library

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Newlib mailing list