mach_port_names.html   [plain text]

<strong>Function</strong> - Return information about a task's port name space.
<strong>kern_return_t   mach_port_names</strong>
                <strong>(ipc_space_t</strong>                               <var>task</var>,
                 <strong>mach_port_name_array_t</strong>                  <var>*names</var>,
                 <strong>mach_msg_type_number_t</strong>               <var>*namesCnt</var>,
                 <strong>mach_port_type_array_</strong>                   <var>*types</var>,
                 <strong>mach_msg_type_number_t</strong>               <var>*typesCnt</var><strong>);</strong>
<dt> <var>task</var> 
[in task send right]
The task whose port name space is queried.
<dt> <var>names</var> 
[out pointer to dynamic array of <var>mach_port_name_t</var>]
The names of the 
ports, port sets, and dead names in the task's port name space, in no 
particular order.
<dt> <var>namesCnt</var> 
[out scalar]
The number of names returned.
<dt> <var>types</var> 
[out pointer to dynamic array of <var>mach_port_type_t</var>]
The type of each 
corresponding name.  Indicates what kind of rights the task holds with 
that name.
<dt> <var>typesCnt</var> 
[out scalar]
The number of types returned.
The <strong>mach_port_names</strong> returns information about <var>task</var>'s
port name space.  It
returns task's currently active names, which represent some port,
port set, or dead 
name right.  For each name, it also returns what type of rights
<var>task</var> holds (the 
same information returned by <strong>mach_port_type</strong>).
Note that when a call to <strong>mach_port_names</strong> returns, the
number of entries in the two output arrays (<var>names</var> and <var>types</var>)
are equal (<var>namesCnt</var> equals <var>typesCnt</var>).  The fact that this
interface returns two separate counts is an artifact of the Mach Interface Generator.
This interface is machine word length specific because of the port name
parameter and the returned port names.
Only generic errors apply.
<a href="mach_port_type.html"><strong>mach_port_type</strong></a>.