Next: Syscall Emulation, Previous: Task Execution, Up: Task Interface
The function
task_get_special_portreturns send rights to one of a set of special ports for the task specified by task.The special ports associated with a task are the kernel port (
TASK_KERNEL_PORT), the bootstrap port (TASK_BOOTSTRAP_PORT) and the exception port (TASK_EXCEPTION_PORT). The bootstrap port is a port to which a task may send a message requesting other system service ports. This port is not used by the kernel. The task's exception port is the port to which messages are sent by the kernel when an exception occurs and the thread causing the exception has no exception port of its own.The following macros to call
task_get_special_portfor a specific port are defined inmach/task_special_ports.h:task_get_exception_portandtask_get_bootstrap_port.The function returns
KERN_SUCCESSif the port was returned andKERN_INVALID_ARGUMENTif task is not a task or which_port is an invalid port selector.
The function
task_get_kernel_portis equivalent to the functiontask_get_special_portwith the which_port argument set toTASK_KERNEL_PORT.
The function
task_get_exception_portis equivalent to the functiontask_get_special_portwith the which_port argument set toTASK_EXCEPTION_PORT.
The function
task_get_bootstrap_portis equivalent to the functiontask_get_special_portwith the which_port argument set toTASK_BOOTSTRAP_PORT.
The function
thread_set_special_portsets one of a set of special ports for the task specified by task.The special ports associated with a task are the kernel port (
TASK_KERNEL_PORT), the bootstrap port (TASK_BOOTSTRAP_PORT) and the exception port (TASK_EXCEPTION_PORT). The bootstrap port is a port to which a thread may send a message requesting other system service ports. This port is not used by the kernel. The task's exception port is the port to which messages are sent by the kernel when an exception occurs and the thread causing the exception has no exception port of its own.The function returns
KERN_SUCCESSif the port was set andKERN_INVALID_ARGUMENTif task is not a task or which_port is an invalid port selector.
The function
task_set_kernel_portis equivalent to the functiontask_set_special_portwith the which_port argument set toTASK_KERNEL_PORT.