IOServiceOpen

Function IOServiceOpen 

Source
pub unsafe extern "C-unwind" fn IOServiceOpen(
    service: io_service_t,
    owning_task: task_t,
    type: u32,
    connect: *mut io_connect_t,
) -> kern_return_t
Available on crate feature libc only.
Expand description

A request to create a connection to an IOService.

A non kernel client may request a connection be opened via the IOServiceOpen() library function, which will call IOService::newUserClient in the kernel. The rules & capabilities of user level clients are family dependent, the default IOService implementation returns kIOReturnUnsupported.

Parameter service: The IOService object to open a connection to, usually obtained via the IOServiceGetMatchingServices or IOServiceAddNotification APIs.

Parameter owningTask: The mach task requesting the connection.

Parameter type: A constant specifying the type of connection to be created, interpreted only by the IOService’s family.

Parameter connect: An io_connect_t handle is returned on success, to be used with the IOConnectXXX APIs. It should be destroyed with IOServiceClose().

Returns: A return code generated by IOService::newUserClient.

§Safety

connect must be a valid pointer.