I'm sure this is a FAQ, but I sure can't find the answer. I've tried the
usually suggested gethostname()/gethostbyname() approach, but that only
returns the *first* match in /etc/hosts. In one case that was 127.0.0.1.
Clearly this was a case where /etc/host.conf gave priority to the host file.
>Use gethostname()/gethostbyname() (or gethostbyaddr()) and then look
>through the 'h_addr_list' array in the 'struct hostent' returned by
>gethostbyname(). That should contain all the network addresses that
>were found for the given host.
That doesn't work when the lookup matches an entry in /et
Excellent, that's just what I was looking for! Thanks.
>do a man getifaddrs(3)
>
>Bruce
_
Chat with friends online, try MSN Messenger: http://messenger.msn.com
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe fr
x27;d rather not depend on that.
>On Thu, Jul 18, 2002 at 09:52:14AM -0700, Chuck T. wrote:
> > Excellent, that's just what I was looking for! Thanks.
> > >do a man getifaddrs(3)
> > >
> > >Bruce
>
>Just be aware that getifaddrs(3) (which does seem