Linux: Correctly identify valid error codes
[syserr.errcat.objects]p4 specifies that
system_category().default_error_condition(ev) map to
error_condition(posv, generic_category()) if ev could map to a POSIX
errno.
Linux reserves up to and including 4095 for errno values, use this as a
bound.
This fixes syserr.errcat.objects/system_category.pass.cpp on Linux.
llvm-svn: 209795
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 31234844ef002f718d5ab3588535e12ac53819d4
diff --git a/src/ios.cpp b/src/ios.cpp
index 03af978..e241394 100644
--- a/src/ios.cpp
+++ b/src/ios.cpp
@@ -56,7 +56,9 @@
if (ev != static_cast<int>(io_errc::stream)
#ifdef ELAST
&& ev <= ELAST
-#endif
+#elif defined(__linux__)
+ && ev <= 4095
+#endif // ELAST
)
return __do_message::message(ev);
return string("unspecified iostream_category error");