3 #ifndef __CDS_OS_POSIX_SYSERROR_H
4 #define __CDS_OS_POSIX_SYSERROR_H
6 #include <stdlib.h> // system
14 namespace cds { namespace OS {
16 /// Posix error code type
17 typedef int error_code;
19 /// Get text for system error \p nCode
20 static inline std::string getSystemErrorText( error_code nCode )
22 char *msg = strerror( nCode );
23 return std::string( msg );
26 /// Get curent error code (returns \p errno)
27 static inline error_code getErrorCode()
34 using posix::error_code;
35 using posix::getErrorCode;
36 using posix::getSystemErrorText;
37 }} // namespace cds::OS
40 #endif // #ifndef __CDS_OS_POSIX_SYSERROR_H