25 #include <sys/utsname.h>
30 int rc = ::uname( &info ) ;
32 return std::string() ;
34 std::string name = std::string(info.nodename) ;
35 std::string::size_type pos = name.find(
'.') ;
36 if( pos != std::string::npos )
37 name = name.substr( 0U , pos ) ;
static std::string get(const std::string &name, const std::string &default_)
Returns the environment variable value or the given default.
std::string hostname()
Returns the hostname.
static std::string toPrintableAscii(char c, char escape= '\\')
Returns a 7-bit printable representation of the given input character.