Re: gethostname returns loginname on "Pather Server" version
Re: gethostname returns loginname on "Pather Server" version
- Subject: Re: gethostname returns loginname on "Pather Server" version
- From: Justin Walker <email@hidden>
- Date: Sat, 7 Feb 2004 11:01:58 -0800
On Saturday, February 7, 2004, at 03:55 AM, Sanjay Arora wrote:
That means relying on the name returned by gethostname() isn't
sufficient,
as it may not have any association with a DNS name.
given these scenarios then, what would be the best and consize way for
a
to find the IPAddress of the System in a BSD way which works for all
systems.
You should go back and reread the content of this thread. There are
several issues for you:
1) in the first place, there is nothing that can be called "the
IPAddress of the System".
2) in the second place, if by "for all systems" you mean Mac OS X, Mac
OS 9, BSD, Linux... then there probably is no "best" way. If you mean
"for all Mac OS X systems", there is a slightly better answer, but APIs
are evolving, so newer systems have better APIs. And the future is
tomorrow...
3) why do you need "the IP address"?
At the low-level, there are the getnameinfo/getaddrinfo and getifaddrs
calls; at a higher level is the SystemConfiguration framework. Each
approach has a different impact on your design, but the tools are there.
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | It's not whether you win or
lose...
| It's whether *I* win or lose.
*--------------------------------------*-------------------------------*
_______________________________________________
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.