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 while in a KEXT? I can use C++ or C.
 
I'm sure there's a few ways...

getenv("$HOSTNAME");

might be one way.

char myhost[20];
gethostname(&myhost, sizeof(myhost));

is another...

There may be some more Mac specific API calls to do this as well...
 
Are you sure these can be called from kernel level? When I try it they are not found.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.