xref: /xnu-10002.1.13/osfmk/man/task_set_emulation.html (revision 1031c584a5e37aff177559b9f69dbd3c8c3fd30a)
1*1031c584SApple OSS Distributions<h2>task_set_emulation</h2>
2*1031c584SApple OSS Distributions<hr>
3*1031c584SApple OSS Distributions<p>
4*1031c584SApple OSS Distributions<strong>Function</strong> - Establish a user-level handler for a system call.
5*1031c584SApple OSS Distributions<h3>SYNOPSIS</h3>
6*1031c584SApple OSS Distributions<pre>
7*1031c584SApple OSS Distributions<strong>kern_return_t   task_set_emulation</strong>
8*1031c584SApple OSS Distributions                <strong>(task_t</strong>                                    <var>task</var>,
9*1031c584SApple OSS Distributions                 <strong>vm_address_t</strong>                  <var>routine_entry_pt</var>,
10*1031c584SApple OSS Distributions                 <strong>int</strong>                             <var>syscall_number</var><strong>);</strong>
11*1031c584SApple OSS Distributions</pre>
12*1031c584SApple OSS Distributions<h3>PARAMETERS</h3>
13*1031c584SApple OSS Distributions<dl>
14*1031c584SApple OSS Distributions<p>
15*1031c584SApple OSS Distributions<dt> <var>task</var>
16*1031c584SApple OSS Distributions<dd>
17*1031c584SApple OSS Distributions[in task port] The port for the task for which to establish the system call handler.
18*1031c584SApple OSS Distributions<p>
19*1031c584SApple OSS Distributions<dt> <var>routine_entry_pt</var>
20*1031c584SApple OSS Distributions<dd>
21*1031c584SApple OSS Distributions[in scalar] The address within the task of the handler for this particular system call.
22*1031c584SApple OSS Distributions<p>
23*1031c584SApple OSS Distributions<dt> <var>syscall_number</var>
24*1031c584SApple OSS Distributions<dd>
25*1031c584SApple OSS Distributions[in scalar] The number of the system call to be handled by this handler.
26*1031c584SApple OSS Distributions</dl>
27*1031c584SApple OSS Distributions<h3>DESCRIPTION</h3>
28*1031c584SApple OSS Distributions<p>
29*1031c584SApple OSS DistributionsThe <strong>task_set_emulation</strong> function establishes a handler within the task
30*1031c584SApple OSS Distributionsfor a particular system call. When a thread executes a system call
31*1031c584SApple OSS Distributionswith this particular number, the system call will be redirected to the
32*1031c584SApple OSS Distributionsspecified routine within the task's address space. This is expected to
33*1031c584SApple OSS Distributionsbe an address within the transparent emulation library.  These
34*1031c584SApple OSS Distributionsemulation handler addresses are inherited by child processes.
35*1031c584SApple OSS Distributions<h3>NOTES</h3>
36*1031c584SApple OSS Distributions<p>
37*1031c584SApple OSS DistributionsThis interface is machine word length specific because of the virtual
38*1031c584SApple OSS Distributionsaddress parameter.
39*1031c584SApple OSS Distributions<h3>RETURN VALUES</h3>
40*1031c584SApple OSS Distributions<p>
41*1031c584SApple OSS DistributionsOnly generic errors apply.
42*1031c584SApple OSS Distributions<h3>RELATED INFORMATION</h3>
43*1031c584SApple OSS Distributions<p>
44*1031c584SApple OSS DistributionsFunctions:
45*1031c584SApple OSS Distributions<a href="task_set_emulation_vector.html"><strong>task_set_emulation_vector</strong></a>,
46*1031c584SApple OSS Distributions<a href="task_get_emulation_vector.html"><strong>task_get_emulation_vector</strong></a>.
47