10 #include <sys/types.h> 11 #include <sys/utsname.h> 27 ::sprintf( fname,
"/proc/%d/cmdline", ::getpid() );
28 FILE* cmdLine = ::fopen( fname,
"r" );
36 long len = ::fread( cmd,
sizeof(
char ),
sizeof( cmd ), cmdLine );
39 for (
char* token = cmd; token - cmd < len; token += ::strlen( token ) + 1 ) {
55 abi::__cxa_demangle( class_name,
nullptr,
nullptr, &status ),
std::free );
56 if ( !realname )
return class_name;
60 "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >( (?=>))?"};
73 static const size_t STRING_SIZE = 512;
75 if (::gethostname( hname.
data(), STRING_SIZE ) ) {
96 if (::uname( &ut ) ) {
97 return "UNKNOWN Linux";
106 if (::uname( &ut ) ) {
107 return "UNKNOWN version";
116 if (::uname( &ut ) ) {
125 const char* acct = ::getlogin();
126 if ( !acct ) acct = ::getenv(
"LOGNAME" );
127 if ( !acct ) acct = ::getenv(
"USER" );
129 return ( acct ? acct :
"UNKNOWN" );
std::string osVersion()
Get the operating system's version.
std::string accountName()
Get the account name of the current user.
std::string machineType()
Get the runner machine's type.
Note: OS specific details for environment resolution.
std::string typeinfoName(const char *class_name)
Get the human readable type name from a typeinfo name.
std::vector< std::string > cmdLineArgs()
Get the command line arguments of the process.
std::string hostName()
Get the system's host name.
T regex_replace(T...args)
std::string osName()
Get the operating system's name.