## mach_task_self

System Trap - Return a send right to the caller's task_self port.

### SYNOPSIS

    #include<mach/mach_traps.h>

    mach_port_t   mach_task_self (void)

### PARAMETERS

None.

### DESCRIPTION

The mach_task_self function returns send rights to the task's kernel port.

### NOTES

This function call is redefined in the mach_init.h file to return the caller's mach_task_self_ environment variable, which is cached on behalf of the caller's task at runtime. (The mach_init.h file is itself included via the mach.h file.

### RETURN VALUES

Only generic errors apply.

### RELATED INFORMATION

Functions: task_set_special_port.