Re: Getting hostname info from within kernel code
Re: Getting hostname info from within kernel code
- Subject: Re: Getting hostname info from within kernel code
- From: Mike Smith <email@hidden>
- Date: Tue, 14 Feb 2006 09:36:50 -0800
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.
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.
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden