getnameinfo() and NI_NOFQDN
getnameinfo() and NI_NOFQDN
- Subject: getnameinfo() and NI_NOFQDN
- From: Mike Richmond <email@hidden>
- Date: Wed, 27 Jul 2005 10:38:05 +0100
I am trying to get an unqualified name for the local host. To do
this I loop over the addresses returned by getifaddrs(), select the
first AF_INET, running, non-loopback address and call getnameinfo()
with the NI_NAMEREQD and NI_NOFQDN flag set. I'm expecting the host
name returned by getnameinfo() to be unqualified, but I am getting a
fully qualified name as if NI_NOFQDN had not been set. I see this on
10.3.9 and 10.4.2.
I've looked at the source at
<http://www.opensource.apple.com/darwinsource/10.4.2/bind9-11/bind9/lib/lwres/getnameinfo.c>
and that does take notice of the NI_NOFQDN flag. Am I looking at the
right code? Am I mis-understanding what the NI_NOFQDN flag does?
Mike Richmond
Global Graphics Software Ltd
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden