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: Andrew Gallatin <email@hidden>
- Date: Tue, 14 Feb 2006 08:28:45 -0500 (EST)
Alexander Kluyev writes:
> Hi guys,
>
> 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.
You're not allowed to access these variables directly, as they
are not exported. The last I checked, you cannot use sysctl
to access them from inside the kernel, and sysctlbyname does
not work for kern.hostname. I had to get around this by launching
a usermode helper which then told my kext what the hostname was.
Talk about Rube Goldburg...
Drew
_______________________________________________
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