osfmk/man/mach_port_allocate_qos.html
Function - Allocate a port with specified "quality of service."
**kern\_return\_t mach\_port\_allocate\_qos**** (ipc\_space\_t **task,** mach\_port\_right\_t **right,** mach\_port\_qos\_t **qos,** mach\_port\_name\_t\ ***name** );**
task[in task send right] The task acquiring the port right to the allocated port. right[in scalar] The type of port right to map to the allocated port. qos[pointer to an in/out structure] Structure used to specify the desired "quality of service." This structure indicates whether or not the caller is providing a name for the port and whether or not the port will exhibit realtime behavior. name[in/out scalar] The name of the installed port right, either specified by the caller or chosen by the system.
The mach_port_allocate_qos function allocates a port with caller-specified "quality of service" characteristics with or without a caller-specified name; in other words, the caller may specify a desired name or it may let the kernel generate the name. The new port is capable of supporting full Mach port semantics (i.e no-more-senders notification can be requested on the port).
This interface is machine word length specific because of the port name parameter.
KERN_NO_SPACE There was no room in task's IPC name space for another right. KERN_INVALID_VALUE The type of right specified by right is either invalid or conflicts with the requested "quality of service" as specified via qos.
Functions: mach_port_allocate, mach_port_allocate_full, mach_port_allocate_name, mach_port_deallocate, mach_port_insert_right, mach_port_extract_right.
Structures: mach_port_qos.