Function - Establish a user-level handler for a system call.
kern_return_t task_set_emulation (task_t task, vm_address_t routine_entry_pt, int syscall_number);
The task_set_emulation function establishes a handler within the task for a particular system call. When a thread executes a system call with this particular number, the system call will be redirected to the specified routine within the task's address space. This is expected to be an address within the transparent emulation library. These emulation handler addresses are inherited by child processes.
This interface is machine word length specific because of the virtual address parameter.
Only generic errors apply.
Functions: task_set_emulation_vector, task_get_emulation_vector.