Files
Lalita Hegade 013178c00e Use a thread-safe strerror in Errno.description
strerror(3) isn't guaranteed to be thread-safe: for an unknown error
number, it may format the message into a static buffer shared by all
threads, so concurrent calls to Errno.description could return each
other's text.

Add a csystem_strerror_r shim to CSystem that writes into a
caller-provided buffer. It hides the difference between the XSI
strerror_r (Darwin, BSDs, musl, WASI) and the GNU variant that glibc
and bionic provide under _GNU_SOURCE, and uses strerror_s on Windows.
Errno.description now formats into a stack buffer through this shim.

Also add tests for Errno.description, which were a TODO.

Fixes #156
2026-11-11 17:46:01 +01:00
..