swift-system
swift-system copied to clipboard
strerror is not (guaranteed) to be thread safe
This package's Errno type is using strerror to produce error strings. For unknown error numbers strerror writes a string into a static buffer and returns it, but whether this static buffer is thread local is unspecified. Using strerror_r would guarantee thread safety even for unknown error codes.
We might want to use strerror_s from C11 instead, for portability.