osfmk/man/mach_port_insert_member.html
Function - Move the specified receive right into or out of the specified port set.
**kern\_return\_t mach\_port\_insert\_member** **(ipc\_space\_t**_task_, **mach\_port\_name\_t** _member_, **mach\_port\_name\_t** _set_**);**
task[in task send right] The task holding the port set and receive right.member[in scalar] The task's name for the receive right.set[in scalar] The task's name for the port set.
The mach_port_insert_member function adds a receive right to a port set. If the receive right is already a member of another port set, that relationship is unafected by this operation. A receive right can be in multiple port sets simultaneously.
This interface is machine word length specific because of the port name parameter.
KERN_INVALID_NAME member or set did not denote a right. KERN_INVALID_RIGHT member denoted a right, but not a receive right, or set denoted a right, but not a port set.
Functions: mach_port_extract_member, mach_port_move_member, mach_port_get_set_status, mach_port_get_attributes.