HomeFreeBSD

__vprintf(): switch from strerror() to strerror_rl()

Description

__vprintf(): switch from strerror() to strerror_rl()

This eliminates the use of non-thread-safe function in printf*() family,
and make the call locale-aware. Also, it stops obliterating the
strerror() static buffer, which aligns with the POSIX requirement that
implementations must behave as if no standard-mandated functions call
strerror().

PR: 278556
Reported by: Jonathan Gruber <jonathan.gruber.jg@gmail.com>
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44916

Details

Provenance
kibAuthored on Apr 23 2024, 5:10 PM
Reviewer
imp
Differential Revision
D44916: Stop using strerror() in printf*() guts
Parents
rG92771bc00ad0: libc: make strerror_rl() usable for libc
Branches
Unknown
Tags
Unknown