NAME
port_insert_send-gives a task send rights for a port
port_insert_receive-gives a task receive/ownership rights for a port

SYNOPSIS
#include <mach.h>

kern_return_t port_insert_send(task, my_port, his_name)
task_t task;
port_t my_port;
port_name_this_name;

kern_return_t port_insert_receive(task, my_port, his_name)
task_t task;
port_t my_port;
port_name_this_name;

ARGUMENTS
task The task getting the new rights.

my_port Rights supplied by the caller.

his_name The name by which task will know the new rights.

DESCRIPTION
port_insert_send and port_insert_receive give a task rights with a
specific name. If task already has rights named his_name, or has
some other name for my_port, then the operation will fail.
his_name can’t be a distinguished value like PORT_NULL.

port_insert_send inserts send rights, and port_insert_receive
inserts receive and ownership rights.

DIAGNOSTICS
KERN_SUCCESS The call succeeded.

KERN_NAME_EXISTS task already has a right named his_name.

KERN_FAILURE task already has rights to my_port.

KERN_INVALID_ARGUMENT task was invalid or new_name was an
invalid name.

BUGS
There is no way to insert just receive rights or just ownership
rights.

SEE ALSO
port_extract(2)