gethostname
gethostname
- Subject: gethostname
- From: Quick David L KPWA <email@hidden>
- Date: Thu, 20 May 2004 15:21:59 -0700
I am moving some applications to Mac OS X from Solaris that use the
following code:
if (gethostname(name, sizeof(name)) == -1)
perror ("Dgps:OpenServerSocket:gethostname");
if ((host = gethostbyname(name)) == NULL)
perror ("Dgps:OpenServerSocket:gethostbyname");
This does not work in OS X unless host name entries are made in the
etc/hosts file. I would rather make the apps use the Netinfo entries or get
the values from the Systemname.local setting. Can anyone tell me how to do
this? Pretty new to OS X so any help would be appreciated.
David L. Quick
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.