Contents

IOCreateReceivePort(_:_:)

Creates and returns a mach port suitable for receiving IOKit messages of the specified type.

Declaration

func IOCreateReceivePort(_ msgType: UInt32, _ recvPort: UnsafeMutablePointer<mach_port_t>!) -> kern_return_t

Parameters

  • msgType:

    Type of message to be sent to this port (kOSNotificationMessageID or kOSAsyncCompleteMessageID)

  • recvPort:

    The created port is returned.

Return Value

A kern_return_t error code.

Discussion

In the future IOKit may use specialized messages and ports instead of the standard ports created by mach_port_allocate(). Use this function instead of mach_port_allocate() to ensure compatibility with future revisions of IOKit.

See Also

Miscellaneous