Gethostname returns incomplete name
site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com Thread-index: Acsdbe1LLp5Wh61/rkinrCmNlyvm4AAJFcaI Thread-topic: Gethostname returns incomplete name User-agent: Microsoft-Entourage/12.20.0.090605 The following code snippet seems to work on intel but I get mixed results on powerpc. Gethostname always returns noErr but sometimes the name I get back doesn't work in gethostbyname. Result: Host is nil and h_errno is 1. char hostnamebuf[256]; struct hostent *host; if ((err = gethostname(hostnamebuf, sizeof(hostnamebuf))) == 0) host = gethostbyname(hostnamebuf); Example: The name I get is "plechatovm2k3-0" The name I should get is "plechatovm2k3-0.lss.corp.com". This one works when I hard code it. Any ideas? Thanks Laurie Gill Roxio Retrospect Sonic Solutions _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Laurie Gill