+bool wxGetHostName(wxChar *buf, int sz)
+{
+ bool ok = wxGetHostNameInternal(buf, sz);
+
+ if ( ok )
+ {
+ // BSD systems return the FQDN, we only want the hostname, so extract
+ // it (we consider that dots are domain separators)
+ wxChar *dot = wxStrchr(buf, _T('.'));
+ if ( dot )
+ {
+ // nuke it
+ *dot = _T('\0');
+ }
+ }
+
+ return ok;
+}
+
+bool wxGetFullHostName(wxChar *buf, int sz)
+{
+ bool ok = wxGetHostNameInternal(buf, sz);
+
+ if ( ok )
+ {
+ if ( !wxStrchr(buf, _T('.')) )
+ {
+ struct hostent *host = gethostbyname(wxConvCurrent->cWX2MB(buf));
+ if ( !host )
+ {
+ wxLogSysError(_("Cannot get the official hostname"));
+
+ ok = FALSE;
+ }
+ else
+ {
+ // the canonical name
+ wxStrncpy(buf, wxConvCurrent->cMB2WX(host->h_name), sz);
+ }
+ }
+ //else: it's already a FQDN (BSD behaves this way)
+ }
+
+ return ok;
+}
+
+bool wxGetUserId(wxChar *buf, int sz)