1 <h2>mach_subsystem_create
</h2>
4 <strong>Function
</strong> - Register information about an RPC subsystem.
7 <strong>kern_return_t mach_subsystem_create
</strong>
8 <strong>(task_t
</strong> <var>target_task
</var>,
9 <strong>user_subsystem_t
</strong> <var>user_subsys
</var>,
10 <strong>mach_msg_type_number_t
</strong> <var>user_subsysCnt
</var>,
11 <strong>subsystem_t
</strong> <var>subsystem_t
</var><strong>);
</strong>
16 <dt> <var>target_task
</var>
18 The task for which the subsystem is registered; normally the calling
19 task, but not necessarily.
21 <dt> <var>user_subsys
</var>
23 The MIG-generated data structure describing the exported routines and
24 their input/output characteristics (e.g. arguments and return values).
26 <dt> <var>user_subsysCnt
</var>
28 The size of the user_subsys data structure argument, in bytes.
30 <dt> <var>subsys
</var>
32 The port returned that names the registered subsystem.
36 The
<strong>mach_subsystem_create
</strong> function is used by a server to register
37 information about an RPC subsystem with the kernel.
38 MIG automatically generates, in the server source file, a
39 <strong>user_subsystem_t
</strong> data structure that is appropriate for registering
40 the subsystem. This data structure includes a per-routine array that
44 The address of the server function that performs the work.
46 The address of the MIG-generated server-side marshalling stub, to be
47 used with
<strong>mach_msg
</strong>.
49 The argument signature (i.e. NDR-style argument format) of the
53 Upon successful completion,
<strong>mach_subsystem_create
</strong> returns,
54 via the
<var>subsys
</var> parameter, a port naming the registered subsystem.
56 Each port on which the server is to receive short-circuited RPC's (or
57 a
<strong>mach_rpc
</strong> call) must be associated with a registered subsystem, by
58 calling
<strong>mach_port_allocate_subsystem
</strong>.
59 <h3>RETURN VALUES
</h3>
62 <dt> <strong>KERN_INVALD_ADDRESS
</strong>
64 One or more of the addresses in the range specified by the subsystem
65 address and size are not valid addresses in the caller, or some of the
66 internal pointers in the subsystem do not point to places within the
67 address range (all of the data of the subsystem is required to be
68 contiguous, even the parts that are pointed to by other parts).
70 <dt> <strong>KERN_INVALID_ARGUMENT
</strong>
72 The port name specified by
<var>target_task
</var> is not a send right naming a task,
73 or the subsystem size is too small to be valid.
75 <dt> <strong>KERN_INVALID_TASK
</strong>
77 The target task is dead.
79 <dt> <strong>KERN_RESOURCE_SHORTAGE
</strong>
81 The kernel cannot allocate the subsystem due to insufficient available
84 <h3>RELATED INFORMATION
</h3>
87 <a href=
"MP_allocate_subsystem.html"><strong>mach_port_allocate_subsystem
</strong></a>,
88 <a href=
"thread_activation_create.html"><strong>thread_activation_create
</strong></a>.