16 Library introduction [library]

16.4 Library-wide requirements [requirements]

16.4.6 Conforming implementations [conforming] Value of error codes [value.error.codes]

Certain functions in the C++ standard library report errors via a std​::​error_code object.
That object's category() member shall return std​::​system_category() for errors originating from the operating system, or a reference to an implementation-defined error_category object for errors originating elsewhere.
The implementation shall define the possible values of value() for each of these error categories.
[Example 1: 
For operating systems that are based on POSIX, implementations should define the std​::​system_category() values as identical to the POSIX errno values, with additional values as defined by the operating system's documentation.
Implementations for operating systems that are not based on POSIX should define values identical to the operating system's values.
For errors that do not originate from the operating system, the implementation may provide enums for the associated values.
— end example]