int rc = gethostname(buf, bufsize); if (rc == -1) { msl_warn("can't get host name " << strerror(errno)); } else { struct hostent *host = gethostbyname(buf); m_host = host->h_name; }