Re: Gethostname returns incomplete name
site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com On Jul 6, 2010, at 22:07 , Laurie Gill wrote: Justin -- Justin C. Walker Curmudgeon at Large Director Institute for the Enhancement of the Director's Income -- Build a man a fire and he'll be warm for a night. Set a man on fire and he'll be warm for the rest of his life. _______________________________________________ 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.... 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. gethostname() just returns whatever was previously set by sethostname() (which is not a Posix call, AFAIK). Whether it returns something sensible is up to the last caller :-}. This email sent to site_archiver@lists.apple.com
participants (1)
-
Justin C. Walker