Function - Establish a connection to a device.
#include<device/device.h> kern_return_t device_open (mach_port_t master_port, mach_port_t ledger, dev_mode_t mode, security_token_t security_id, dev_name_t name, mach_port_t device); #include<device/device_request.h> kern_return_t device_open_request (mach_port_t master_port, mach_port_t reply_port, mach_port_t ledger, dev_mode_t mode, security_token_t security_id, dev_name_t name); kern_return_t ds_device_open_reply (mach_port_t reply_port, kern_return_t return_code, mach_port_t device);
The device_open function opens a device object. The open operation of the device is invoked, if the device is not already open. The open count for the device is incremented. Each open for a device returns a port, the allowed operations upon which being governed by mode. The port is not distinct.
Only generic errors apply.
Functions: device_close, device_reply_server.