Ok, continuing with converting my app to Swift...
I need to call IOMasterPort but I cannot figure out exactly how to set up the call. I have this working fine in my Obj-C code BTW.
The docs. give the definition:
func IOMasterPort(_
bootstrapPort
: mach_port_t, _ masterPort
: UnsafeMutablePointer<mach_port_t>) -> kern_return_tand say that you can pass MACH_PORT_NULL as the default for the bootstrapPort. This is potentially an issue since the compiler is identifying MACH_PORT_NULL as a UInt32 whereas the function definition calls for a mach_port_t. That may not be an actual problem, since I cannot figure out how to pass the second parameter which is specified as:
UnsafeMutablePointer<mach_port_t>
so I tried:
var mPort: mach_port_t = kIOMasterPortDefault
var mPortP: UnsafeMutablePointer<mach_port_t>
mPortP = &mPort
but I get the compiler error:
'inout mach_port_t' is not convertible to 'UnsafeMutablePointer<mach_port_t>'
Anyone know how I can get an UnsafeMutablePointer to a mach_port_t?