darling-xnu/osfmk/man/MP_allocate_subsystem.html
2023-05-16 21:41:14 -07:00

75 lines
2.2 KiB
HTML

<h2>mach_port_allocate_subsystem</h2>
<hr>
<p>
<strong>Function</strong> - Create a port right associated with the caller-specified subsystem.
<h3>SYNOPSIS</h3>
<pre>
<strong>kern_return_t mach_port_allocate_subsystem</strong>
<strong>(ipc_space_t</strong> <var>task</var>,
<strong>subsystem_t</strong> <var>subsys</var>,
<strong>mach_port_name_t</strong> <var>mach_port_name_t</var><strong>);</strong>
</pre>
<h3>PARAMETERS</h3>
<dl>
<p>
<dt> <var>task</var>
<dd>
[in task send right] The task acquiring the port right.
<p>
<dt> <var>subsys</var>
<dd>
[in scalar] The port right naming the subsystem the newly created port
is to be associated with.
<p>
<dt> <var>name</var>
<dd>
[out scalar] The task's name for the port right. This can be any name
that wasn't in use.
</dl>
<h3>DESCRIPTION</h3>
<p>
The <strong>mach_port_allocate_subsystem</strong> function creates a new right
and associates it
with the specifed subsystem (specified via the <var>subsys</var> parameter)
previously registered via a call to the
<strong>mach_subsystem_create</strong> interface.
The new right's name is returned in the <var>name</var> parameter. The
association of this port with the subsystem is immutable for the
life of the port.
<p>
Any RPC targeted at the new port will cause the kernel glue-code
to locate the server function address and argument signature in the
associated subsystem.
<h3>NOTES</h3>
<p>
This interface is machine word length specific because of the port
name parameter.
<h3>RETURN VALUES</h3>
<dl>
<p>
<dt> <strong>KERN_SUCCESS</strong>
<dd>
The right is allocated.
<p>
<dt> <strong>KERN_INVALID_TASK</strong>
<dd>
The space is null.
<p>
<dt> <strong>KERN_INVALID_TASK</strong>
<dd>
The space is dead.
<p>
<dt> <strong>KERN_RESOURCE_SHORTAGE</strong>
<dd>
Couldn't allocate memory.
<p>
<dt> <strong>KERN_NO_SPACE</strong>
<dd>
No room in space for another right.
</dl>
<h3>RELATED INFORMATION</h3>
<p>
Functions:
<a href="mach_subsystem_create.html"><strong>mach_subsystem_create</strong></a>,
<a href="thread_activation_create.html"><strong>thread_activation_create</strong></a>.