Re: Getting hostname info from within kernel code
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On Feb 14, 2006, at 4:40 AM, Alexander Kluyev wrote: Is there way to get hostname (MachineName, ComputerName) from within my KEXT I'm writing? It seems I saw "some useful global variables like hostname, hostnamelen" description somewhere in documentation. However I cannot find it once again. Does anyone have experience regarding that? Thank you. = Mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... Host names are associated with interface addresses, and can change at any moment. Since there's no good way to post notifications for these sorts of events in the kernel, it's generally not a good idea to try to use them there. There's also not much use for hostnames in the kernel, since they have to be converted to protocol addresses before use anyway. The same can be said of the "computer name", although it tends to change even more randomly. You're better off managing name/address translations outside the kernel, since they tend to be asynchronous operations that require the support of large amounts of library infrastructure. This email sent to site_archiver@lists.apple.com
participants (1)
-
Mike Smith