SolidWallOfCode commented on code in PR #9878:
URL: https://github.com/apache/trafficserver/pull/9878#discussion_r1265525519


##########
include/tscpp/util/ts_errata.h:
##########
@@ -40,5 +40,16 @@ static constexpr std::array<swoc::TextView, 9> 
Severity_Names{
   {"Diag", "Debug", "Status", "Note", "Warn", "Error", "Fatal", "Alert", 
"Emergency"}
 };
 
+inline std::error_code
+ec_for()
+{
+  return {errno, std::system_category()};

Review Comment:
   I considered that, but in practice `errno` is system specific (e.g., the 
value can vary between operating systems) and therefore, IMHO, should be 
`system_category`. If we look at the [documentation for 
system_category](https://en.cppreference.com/w/cpp/error/system_category) we see
   
   "Obtains a reference to the static error category object for errors reported 
by the operating system", which is precisely what `errno` is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to