osfmk/man/mach_port_get_set_status.html
Function - Return the port right names contained in the target port set.
**kern\_return\_t mach\_port\_get\_set\_status**** (ipc\_space\_t **task,** mach\_port\_name\_t **name,** mach\_port\_name\_array\_t **\*members,** task **count** );**
task[in task send right] The task holding the port set.
name[in scalar] The task's name for the port set.
members[out pointer to dynamic array of mach_port_name_t] The task's names for the port set's members.
count[out scalar] The number of member names returned.
The mach_port_get_set_status function returns the individual port right names for all port rights contained in the specified port set. The members parameter is an array that is automatically allocated when the reply message is received. Note that vm_deallocate should be used to free the array.
Note that this interface, unlike others such as task_threads , returns a collection of port right names, NOT a collection of port rights themselves. In other words, this function does not insert port rights into the caller's port right name space; consequently, a call to mach_port_get_set_status does not affect the reference count of each port right within the target port set.
This interface is machine word length specific because of the port name parameter and the returned port names.
KERN_INVALID_NAME name did not denote a right.
KERN_INVALID_RIGHT name denoted a right, but not a port set.
Functions: mach_port_insert_member, mach_port_extract_member, mach_port_move_member, vm_deallocate.