NAME
port_names - return information about a task’s port name space

SYNOPSIS
#include <mach.h>

kern_return_t port_names(task, port_names, port_namesCnt,
port_types, port_typesCnt)
task_t task;
port_name_array_t *port_names; /* out array */
unsigned int *port_namesCnt; /* out */
port_type_array_t *port_types; /* out array */
unsigned int *port_typesCnt; /* out */

ARGUMENTS
task The task whose port name space is queried.

port_names The names of the ports and port sets in the task’s
port name space, in no particular order.

port_namesCnt The number of names returned.

port_types The type of each corresponding name. Indicates what
kind of right the task holds for the port or port
set.

port_typesCnt Should be the same as port_namesCnt.

DESCRIPTION
port_names returns information about task’s port name space. It
returns task’s currently valid port and port set names. For each
name, it also returns what type of rights task holds. port_names
and port_types are arrays that are automatically allocated when the
reply message is received. The user may wish to vm_deallocate them
when the data is no longer needed.

DIAGNOSTICS
KERN_SUCCESS The call succeeded.

KERN_INVALID_ARGUMENT task was invalid.

SEE ALSO
port_set_status(2), port_status(2), port_type(2)