E eddyq macrumors member Original poster Jun 10, 2009 96 0 Sep 13, 2009 #1 Is there a way to get the host name while in a KEXT? I can use C++ or C.
pilotError macrumors 68020 Apr 12, 2006 2,237 4 Long Island Sep 13, 2009 #2 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...
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...
E eddyq macrumors member Original poster Jun 10, 2009 96 0 Sep 21, 2009 #3 Are you sure these can be called from kernel level? When I try it they are not found.