-/*********************************************************************
-* This function is for use only by OSKextLib.cpp and OSKext.cpp.
-*
-* xxx - can we cache the kextd port or do we have to get it each time
-* xxx - in case it relaunches?
-*********************************************************************/
-extern void ipc_port_release_send(ipc_port_t);
-
-kern_return_t OSKextPingKextd(void)
-{
- kern_return_t result = KERN_FAILURE;
- mach_port_t kextd_port = IPC_PORT_NULL;
-
- result = host_get_kextd_port(host_priv_self(), &kextd_port);
- if (result != KERN_SUCCESS || !IPC_PORT_VALID(kextd_port)) {
- OSKextLog(/* kext */ NULL,
- kOSKextLogErrorLevel |
- kOSKextLogIPCFlag,
- "Can't get kextd port.");
- goto finish;
- }
-
- result = kextd_ping(kextd_port);
- if (result != KERN_SUCCESS) {
- OSKextLog(/* kext */ NULL,
- kOSKextLogErrorLevel |
- kOSKextLogIPCFlag,
- "kextd ping failed (0x%x).", (int)result);
- goto finish;
- }
-
-finish:
- if (IPC_PORT_VALID(kextd_port)) {
- ipc_port_release_send(kextd_port);
- }
-
- return result;
-}
-