[PATCH] manual: Update documentation of strerror and related functions

Florian Weimer fweimer@redhat.com
Wed Jun 21 09:54:16 GMT 2023


* Florian Weimer:

>  You should not modify the string returned by @code{strerror}.  Also, if
> +you make subsequent calls to @code{strerror} or @code{strerror_l}, or
> +the thread that obtained the string exits, the returned pointer will be
> +invalidated.

I should point out that invalidation of the pointer on a subsequent
strerror or strerror_l call is likely a defect because the standard does
not allow this behavior.  Should we fix it?  It will require maintaining
a list of allocations associated with the current thread.

Thanks,
Florian



More information about the Libc-alpha mailing list