Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getnameinfo() and NI_NOFQDN



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:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.