Alternative api for strerror_r for Windows

I see strerror_r (...) the API is no longer supported in Visual C ++ 2008, probably due to a thread safety issue. I want to use similar functions in my program. Are there other winapi that do the same as strerror_r (..)?

+4
source share
1 answer

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) 
+4
source

All Articles