Function - Return a send right to the caller-specified special port.
kern_return_t thread_get_special_port (thread_act_t thread, int which_port, thread special_port);
kern_return_t thread_get_kernel_port (thread_act_t thread, thread special_port);
The thread_get_special_port function returns a send right for a special port belonging to thread.
The thread kernel port is a port for which the kernel holds the receive right. The kernel uses this port to identify the thread.
If one thread has a send right for the kernel port of another thread, it can use the port to perform kernel operations for the other thread. Send rights for a kernel port normally are held only by the thread to which the port belongs, or by the task that contains the thread. Using the mach_msg function, however, any thread can pass a send right for its kernel port to another thread.
Only generic errors apply.
Functions: mach_thread_self, task_get_special_port, task_set_special_port, thread_create, thread_set_special_port.