## mach_port_type

Function - Return the characteristics of the target port name.

### SYNOPSIS

    kern_return_t   mach_port_type
                    (ipc_space_t                               task,
                     mach_port_name_t                          name,
                     mach_port_type_t                         ptype);

### PARAMETERS

task
  [in task send right] The task whose port name space is queried.

name
  [in scalar] The name being queried.

ptype
  [out scalar] The type of the name. Indicates what kind of right the task holds for the port, port set, or dead name.

### DESCRIPTION

The mach_port_type function returns information about task's rights for a specific name in its port name space. The returned ptype is a bit-mask indicating what rights task holds with this name. The bit-mask is composed of the following bits:

MACH_PORT_TYPE_SEND
  The name denotes send rights.

MACH_PORT_TYPE_RECEIVE
  The name denotes a receive right.

MACH_PORT_TYPE_SEND_ONCE
  The name denotes a send-once right.

MACH_PORT_TYPE_PORT_SET
  The name denotes a port set.

MACH_PORT_TYPE_DEAD_NAME
  The name is a dead name.

MACH_PORT_TYPE_DNREQUEST
  A dead-name request has been registered for the right.

### NOTES

This interface is machine word length specific because of the port name parameter.

### RETURN VALUES

KERN_INVALID_NAME
  name did not denote a right.

### RELATED INFORMATION

Functions: mach_port_names, mach_port_get_attributes, mach_port_get_set_status.