pub unsafe extern "C-unwind" fn IOServiceAddInterestNotification(
notify_port: IONotificationPortRef,
service: io_service_t,
interest_type: *mut [c_char; 128],
callback: IOServiceInterestCallback,
ref_con: *mut c_void,
notification: *mut io_object_t,
) -> kern_return_tlibc only.Expand description
Register for notification of state changes in an IOService.
IOService objects deliver notifications of their state changes to their clients via the IOService::messageClients API, and to other interested parties including callers of this function. Message types are defined IOKit/IOMessage.h.
Parameter notifyPort: A IONotificationPortRef object that controls how messages will be sent when the notification is fired. See IONotificationPortCreate.
Parameter interestType: A notification type from IOKitKeys.h
kIOGeneralInterest General state changes delivered via the IOService::messageClients API.
kIOBusyInterest Delivered when the IOService changes its busy state to or from zero. The message argument contains the new busy state causing the notification.
Parameter callback: A callback function called when the notification fires, with messageType and messageArgument for the state change.
Parameter refCon: A reference constant for the callbacks use.
Parameter notification: An object handle is returned on success, and should be released by the caller when the notification is to be destroyed.
Returns: A kern_return_t error code.
ยงSafety
notify_portmust be a valid pointer.interest_typeArray TODO.callbackmust be implemented correctly.ref_conmust be a valid pointer.notificationmust be a valid pointer.