• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
gethostname
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: gethostname
      • From: Quinn <email@hidden>
  • Prev by Date: Re: POSIX sockets and event loops
  • Next by Date: Re: POSIX sockets and event loops
  • Previous by thread: Re: POSIX sockets and event loops
  • Next by thread: Re: gethostname
  • Index(es):
    • Date
    • Thread