Function - Return information about a task's port name space.
kern_return_t mach_port_names (ipc_space_t task, mach_port_name_array_t *names, mach_msg_type_number_t *namesCnt, mach_port_type_array_ *types, mach_msg_type_number_t *typesCnt);
The mach_port_names returns information about task's port name space. It returns task's currently active names, which represent some port, port set, or dead name right. For each name, it also returns what type of rights task holds (the same information returned by mach_port_type).
Note that when a call to mach_port_names returns, the number of entries in the two output arrays (names and types) are equal (namesCnt equals typesCnt). The fact that this interface returns two separate counts is an artifact of the Mach Interface Generator.
This interface is machine word length specific because of the port name parameter and the returned port names.
Only generic errors apply.