[Boost-bugs] [Boost C++ Libraries] #5377: Use strerror_s to resolve error messages on Windows when possible

Subject: [Boost-bugs] [Boost C++ Libraries] #5377: Use strerror_s to resolve error messages on Windows when possible
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-27 03:39:11


#5377: Use strerror_s to resolve error messages on Windows when possible
---------------------------------------------------------+------------------
 Reporter: Greg Wiley <a507@…> | Owner: bemandawes
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: system
  Version: Boost 1.46.0 | Severity: Problem
 Keywords: strerror strerror_s error_code error system |
---------------------------------------------------------+------------------
 In error_code.cpp, conditional macros choose the system call used to
 resolve error code values to strings (~line 81). The inline documentation
 mentions that strerror_r is used to provide thread-safety on platforms
 that expose that call.

 However, for Windows, the strerror call is always used, which is not
 thread-safe.

 Since VS2005, the Windows API has provided strerror_s, a thread-safe
 alternative to strerror that is similar to strerror_r.

 If possible, the strerror_s call should be used on Windows platforms that
 provide it.

 I am not an expert on the Boost way to select on Windows API versions
 internally so I hesitate to propose a patch but the form would be similar
 to that used for the strerror_r calls in that same area of the code.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5377>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC