Next: Syscall Emulation, Previous: Task Execution, Up: Task Interface
The function
task_get_special_port
returns 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_port
for a specific port are defined inmach/task_special_ports.h
:task_get_exception_port
andtask_get_bootstrap_port
.The function returns
KERN_SUCCESS
if the port was returned andKERN_INVALID_ARGUMENT
if task is not a task or which_port is an invalid port selector.
The function
task_get_kernel_port
is equivalent to the functiontask_get_special_port
with the which_port argument set toTASK_KERNEL_PORT
.
The function
task_get_exception_port
is equivalent to the functiontask_get_special_port
with the which_port argument set toTASK_EXCEPTION_PORT
.
The function
task_get_bootstrap_port
is equivalent to the functiontask_get_special_port
with the which_port argument set toTASK_BOOTSTRAP_PORT
.
The function
thread_set_special_port
sets 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_SUCCESS
if the port was set andKERN_INVALID_ARGUMENT
if task is not a task or which_port is an invalid port selector.
The function
task_set_kernel_port
is equivalent to the functiontask_set_special_port
with the which_port argument set toTASK_KERNEL_PORT
.