| 1 | <h2>task_set_emulation_vector</h2> |
| 2 | <hr> |
| 3 | <p> |
| 4 | <strong>Function</strong> - Establish the target task's user-level system call handlers. |
| 5 | <h3>SYNOPSIS</h3> |
| 6 | <pre> |
| 7 | <strong>kern_return_t task_set_emulation_vector</strong> |
| 8 | <strong>(task_t</strong> <var>task</var>, |
| 9 | <strong>int</strong> <var>vector_start</var>, |
| 10 | <strong>emulation_vector_t</strong> <var>emulation_vector</var>, |
| 11 | <strong>mach_msg_type_number_t</strong> <var>emulation_vector_count</var><strong>);</strong> |
| 12 | </pre> |
| 13 | <h3>PARAMETERS</h3> |
| 14 | <dl> |
| 15 | <p> |
| 16 | <dt> <var>task</var> |
| 17 | <dd> |
| 18 | [in task send right] |
| 19 | The port for the task for which to establish the |
| 20 | system call handler. |
| 21 | <p> |
| 22 | <dt> <var>vector_start</var> |
| 23 | <dd> |
| 24 | [in scalar] |
| 25 | The syscall number corresponding to the first element of |
| 26 | <var>emulation_vector</var>. |
| 27 | <p> |
| 28 | <dt> <var>emulation_vector</var> |
| 29 | <dd> |
| 30 | [pointer to in array of <strong>vm_address_t</strong>] |
| 31 | An array of routine entrypoints |
| 32 | for the system calls starting with syscall number <var>vector_start</var>. |
| 33 | <p> |
| 34 | <dt> <var>emulation_vector_count</var> |
| 35 | <dd> |
| 36 | [in scalar] |
| 37 | The number of elements in <var>emulation_vector</var>. |
| 38 | </dl> |
| 39 | <h3>DESCRIPTION</h3> |
| 40 | <p> |
| 41 | The <strong>task_set_emulation_vector</strong> function establishes |
| 42 | a handler within the task |
| 43 | for a set of system calls. When a thread executes a system call |
| 44 | with one of these |
| 45 | numbers, the system call will be redirected to the corresponding |
| 46 | routine within |
| 47 | the task's address space. |
| 48 | <p> |
| 49 | These emulation handler addresses are inherited by child processes. |
| 50 | <h3>NOTES</h3> |
| 51 | <p> |
| 52 | This interface is machine word length specific because of the |
| 53 | virtual addresses |
| 54 | in the <var>emulation_vector</var> parameter. |
| 55 | <h3>RETURN VALUES</h3> |
| 56 | <p> |
| 57 | Only generic errors apply. |
| 58 | <h3>RELATED INFORMATION</h3> |
| 59 | <p> |
| 60 | Functions: |
| 61 | <a href="task_get_emulation_vector.html"><strong>task_get_emulation_vector</strong></a>. |