Next: Port Sets, Previous: Ports and other Tasks, Up: Port Manipulation Interface
The
mach_port_seqno_tdata type is anunsigned intwhich contains the sequence number of a port.
The
mach_port_mscount_tdata type is anunsigned intwhich contains the make-send count for a port.
The
mach_port_msgcount_tdata type is anunsigned intwhich contains a number of messages.
The
mach_port_rights_tdata type is anunsigned intwhich contains a number of rights for a port.
This structure contains some status information about a port, which can be queried with
mach_port_get_receive_status. It has the following members:
mach_port_t mps_pset- The containing port set.
mach_port_seqno_t mps_seqno- The sequence number.
mach_port_mscount_t mps_mscount- The make-send count.
mach_port_msgcount_t mps_qlimit- The maximum number of messages in the queue.
mach_port_msgcount_t mps_msgcount- The current number of messages in the queue.
mach_port_rights_t mps_sorights- The number of send-once rights that exist.
boolean_t mps_srightsTRUEif send rights exist.boolean_t mps_pdrequestTRUEif port-deleted notification is requested.boolean_t mps_nsrequestTRUEif no-senders notification is requested.
The function
mach_port_get_receive_statusreturns the current status of the specified receive right.The function returns
KERN_SUCCESSif the call succeeded,KERN_INVALID_TASKif task was invalid,KERN_INVALID_NAMEif name did not denote a right andKERN_INVALID_RIGHTif name denoted a right, but not a receive right.The
mach_port_get_receive_statuscall is actually an RPC to task, normally a send right for a task port, but potentially any send right. In addition to the normal diagnostic return codes from the call's server (normally the kernel), the call may returnmach_msgreturn codes.
The function
mach_port_set_mscountchanges the make-send count of task's receive right named name to mscount. All values for mscount are valid.The function returns
KERN_SUCCESSif the call succeeded,KERN_INVALID_TASKif task was invalid,KERN_INVALID_NAMEif name did not denote a right andKERN_INVALID_RIGHTif name denoted a right, but not a receive right.The
mach_port_set_mscountcall is actually an RPC to task, normally a send right for a task port, but potentially any send right. In addition to the normal diagnostic return codes from the call's server (normally the kernel), the call may returnmach_msgreturn codes.
The function
mach_port_set_qlimitchanges the queue limit task's receive right named name to qlimit. Valid values for qlimit are between zero andMACH_PORT_QLIMIT_MAX, inclusive.The function returns
KERN_SUCCESSif the call succeeded,KERN_INVALID_TASKif task was invalid,KERN_INVALID_NAMEif name did not denote a right,KERN_INVALID_RIGHTif name denoted a right, but not a receive right andKERN_INVALID_VALUEif qlimit was invalid.The
mach_port_set_qlimitcall is actually an RPC to task, normally a send right for a task port, but potentially any send right. In addition to the normal diagnostic return codes from the call's server (normally the kernel), the call may returnmach_msgreturn codes.
The function
mach_port_set_seqnochanges the sequence number task's receive right named name to seqno. All sequence number values are valid. The next message received from the port will be stamped with the specified sequence number.The function returns
KERN_SUCCESSif the call succeeded,KERN_INVALID_TASKif task was invalid,KERN_INVALID_NAMEif name did not denote a right andKERN_INVALID_RIGHTif name denoted a right, but not a receive right.The
mach_port_set_seqnocall is actually an RPC to task, normally a send right for a task port, but potentially any send right. In addition to the normal diagnostic return codes from the call's server (normally the kernel), the call may returnmach_msgreturn codes.