You can try strerror_s . It appears to be thread safe.
Note that the order of the strerror_s parameters is different from strerror_r. If you are writing portable code, you can use the definition
#define strerror_r(errno,buf,len) strerror_s(buf,len,errno)
source share