osfmk/man/i386_io_port_add.html
Function - Permit target thread to invoke operations on the specified device.
**kern\_return\_t i386\_io\_port\_add**** (thread\_act\_t **target\_act,** device\_t **device** );**
target_act[in thread send right] Thread whose permission bitmap is to be set.
device[in device send right] The device to which I/O instructions are to be permitted.
The i386_io_port_add function adds a device to the I/O permission bitmap for a thread, thereby permitting the thread to execute I/O instructions against the device.
Normally, the thread must have called i386_io_port_add for all devices to which it will execute I/O instructions. However, possessing send rights to the iopl device port will cause the iopl device to be automatically added to the thread's I/O map upon first attempted access. This is a backward compatibility feature for the DOS emulator.
Only generic errors apply.
Functions: i386_io_port_list, i386_io_port_remove.