1<h2>thread_set_special_port</h2>
2<hr>
3<p>
4<strong>Function</strong> - Set caller-specified special port belonging to the target thread.
5<h3>SYNOPSIS</h3>
6<pre>
7<strong>kern_return_t   thread_set_special_port</strong>
8                <strong>(thread_act_t</strong>                            <var>thread</var>,
9                 <strong>int</strong>                                 <var>which_port</var>,
10                 <strong>mach_port_t</strong>                       <var>special_port</var><strong>);</strong>
11</pre>
12
13<h4>Macro form:</h4>
14<pre>
15<strong>kern_return_t   thread_set_kernel_port</strong>
16                <strong>(thread_act_t</strong>                            <var>thread</var>,
17                 <strong>mach_port_t</strong>                       <var>special_port</var><strong>);</strong>
18</pre>
19<h3>PARAMETERS</h3>
20<dl>
21<p>
22<dt> <var>thread</var> 
23<dd>
24[in thread send right]
25The thread for which to set the port.
26<p>
27<dt> <var>which_port</var> 
28<dd>
29[in scalar]
30The special port to be set.  Valid values are:
31<dl>
32<p>
33<dt> <strong>THREAD_KERNEL_PORT</strong>
34<dd>
35[thread-self port] The thread's kernel port.  Used by the kernel 
36to receive messages from the thread.  This is the port returned 
37by <strong>mach_thread_self</strong>.
38</dl>
39<p>
40<dt> <var>special_port</var> 
41<dd>
42[in thread-special send right]
43The value for the port.
44</dl>
45<h3>DESCRIPTION</h3>
46<p>
47The <strong>thread_set_special_port</strong> function sets a special
48port belonging to <var>thread</var>.
49<h3>RETURN VALUES</h3>
50<p>
51Only generic errors apply.
52<h3>RELATED INFORMATION</h3>
53<p>
54Functions:
55<a href="mach_thread_self.html"><strong>mach_thread_self</strong></a>,
56<a href="task_get_special_port.html"><strong>task_get_special_port</strong></a>,
57<a href="task_set_special_port.html"><strong>task_set_special_port</strong></a>,
58<a href="thread_create.html"><strong>thread_create</strong></a>,
59<a href="thread_get_special_port.html"><strong>thread_get_special_port</strong></a>.
60