]>
Commit | Line | Data |
---|---|---|
9bccf70c | 1 | <h2>mach_subsystem_create</h2>\r<hr>\r<p>\r<strong>Function</strong> - Register information about an RPC subsystem.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t mach_subsystem_create</strong>\r <strong>(task_t</strong> <var>target_task</var>,\r <strong>user_subsystem_t</strong> <var>user_subsys</var>,\r <strong>mach_msg_type_number_t</strong> <var>user_subsysCnt</var>,\r <strong>subsystem_t</strong> <var>subsystem_t</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<p>\r<dt> <var>target_task</var>\r<dd>\rThe task for which the subsystem is registered; normally the calling \rtask, but not necessarily.\r<p>\r<dt> <var>user_subsys</var>\r<dd>\rThe MIG-generated data structure describing the exported routines and \rtheir input/output characteristics (e.g. arguments and return values).\r<p>\r<dt> <var>user_subsysCnt</var>\r<dd>\rThe size of the user_subsys data structure argument, in bytes.\r<p>\r<dt> <var>subsys</var>\r<dd>\rThe port returned that names the registered subsystem.\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>mach_subsystem_create</strong> function is used by a server to register\rinformation about an RPC subsystem with the kernel.\rMIG automatically generates, in the server source file, a\r<strong>user_subsystem_t</strong> data structure that is appropriate for registering\rthe subsystem. This data structure includes a per-routine array that\rspecifies:\r<ul>\r<li>\rThe address of the server function that performs the work.\r<li>\rThe address of the MIG-generated server-side marshalling stub, to be \rused with <strong>mach_msg</strong>.\r<li>\rThe argument signature (i.e. NDR-style argument format) of the\rroutine.\r</ul>\r<p>\rUpon successful completion, <strong>mach_subsystem_create</strong> returns,\rvia the <var>subsys</var> parameter, a port naming the registered subsystem.\r<p>\rEach port on which the server is to receive short-circuited RPC's (or\ra <strong>mach_rpc</strong> call) must be associated with a registered subsystem, by\rcalling <strong>mach_port_allocate_subsystem</strong>.\r<h3>RETURN VALUES</h3>\r<dl>\r<p>\r<dt> <strong>KERN_INVALD_ADDRESS</strong>\r<dd>\rOne or more of the addresses in the range specified by the subsystem\raddress and size are not valid addresses in the caller, or some of the\rinternal pointers in the subsystem do not point to places within the\raddress range (all of the data of the subsystem is required to be\rcontiguous, even the parts that are pointed to by other parts).\r<p>\r<dt> <strong>KERN_INVALID_ARGUMENT</strong>\r<dd>\rThe port name specified by <var>target_task</var> is not a send right naming a task,\ror the subsystem size is too small to be valid.\r<p>\r<dt> <strong>KERN_INVALID_TASK</strong>\r<dd>\rThe target task is dead.\r<p>\r<dt> <strong>KERN_RESOURCE_SHORTAGE</strong>\r<dd>\rThe kernel cannot allocate the subsystem due to insufficient available \rmemory.\r</dl>\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="MP_allocate_subsystem.html"><strong>mach_port_allocate_subsystem</strong></a>,\r<a href="thread_activation_create.html"><strong>thread_activation_create</strong></a>.\r |