osfmk/man/mach_rpc_trap.html
System Trap - Real-Time RPC trap.
**#include<mach/rpc.h>**** mach\_rpc\_return\_t mach\_rpc\_trap****(mach\_port\_t**dest\_port, **mach\_rpc\_id\_t** routine\_num, **mach\_rpc\_signature\_t** signature\_ptr, **mach\_rpc\_size\_t** signature\_size**);**
dest_port[in send right] The port representing the destination of the RPC (usually a registered subsystem established by a call to mach_port_allocate_subsystem ).
routine_num[in scalar] Identifier of the server work function.
signature_ptr[in pointer] Pointer to the call's mach_rpc_signature structure.
signature_size[in scalar] Size, in bytes, of the call's mach_rpc_signature structure.
The mach_rpc_trap system trap is the entry point for the invoke side of the Mach RPC service used to transfer control to an RPC server. The trap is accessed via the MIG generated MACH_RPC macro which is invoked transparently when the mach_rpc feature is enabled. This function is not designed for use directly by the user. It is automatically generated by MIG to handle a function call.
For a complete description of this functionality, refer to: Burke, Edward, Michael Condict, David Mitchell, Franklin Reynolds, Peter Watkins, William Willcox, "RPC Design for Real-Time Mach," OSF Research Institute, Cambridge, MA.
This interface is experimental and therefore subject to change.
KERN_FAILURE Either the argument copyin failed, there were too many arguments, or the argument copyout failed.
KERN_INVALID_ARGUMENT The dest_port, signature_ptr, and/or the subsystem associated with the dest_port is invalid; the siganture_size is less than, or equal to, zero.
KERN_NO_ACCESS The kernel port associated with the dest_port name is a norma proxy port.
KERN_RESOURCE_SHORTAGE The kernel could not allocate storage for an internal rpc state structure.
Functions: mach_rpc_return_trap, thread_activation_create, mach_port_allocate_subsystem, mach_subsystem_create.