Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

eddyq

macrumors member
Original poster
Jun 10, 2009
96
0
Is there a way to get the host name via a C program (while in kernel level)?
 
Is there a way to get the host name via a C program (while in kernel level)?

You may have better luck by asking your query in the MacOS X programming forum.

Sounds like you're writing a kext? Mach's host_info isn't exported (made visible) to the OS X kernel frameworks so you can't call that. The easiest way, even if it's a less-than-elegant workaround, may be to have a user-mode helper stub that gets this information through more conventional library calls and then notifies the kext what the hostname is.
 
Ok, thanks. I'll check with the MacOS X programming forum. If there is nothing directly available in the kernel then I'll just forget it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.