1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>wait_task_stopped</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="ch01s07.html" title="Internal Functions"><link rel="prev" href="ch01s07.html" title="Internal Functions"><link rel="next" href="API-task-set-jobctl-pending.html" title="task_set_jobctl_pending"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">wait_task_stopped</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s07.html">Prev</a>&#160;</td><th width="60%" align="center">Internal Functions</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-task-set-jobctl-pending.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-wait-task-stopped"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>wait_task_stopped &#8212; 
2  Wait for <code class="constant">TASK_STOPPED</code> or <code class="constant">TASK_TRACED</code>
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">wait_task_stopped </b>(</code></td><td>struct wait_opts * <var class="pdparam">wo</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">ptrace</var>, </td></tr><tr><td>&#160;</td><td>struct task_struct * <var class="pdparam">p</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1107841196"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>wo</code></em></span></dt><dd><p>
4     wait options
5    </p></dd><dt><span class="term"><em class="parameter"><code>ptrace</code></em></span></dt><dd><p>
6     is the wait for ptrace
7    </p></dd><dt><span class="term"><em class="parameter"><code>p</code></em></span></dt><dd><p>
8     task to wait for
9    </p></dd></dl></div></div><div class="refsect1"><a name="idp1107844812"></a><h2>Description</h2><p>
10   Handle <code class="function">sys_wait4</code> work for <code class="constant">p</code> in state <code class="constant">TASK_STOPPED</code> or <code class="constant">TASK_TRACED</code>.
11</p></div><div class="refsect1"><a name="idp1107846428"></a><h2>CONTEXT</h2><p>
12   read_lock(<span class="structname">tasklist_lock</span>), which is released if return value is
13   non-zero.  Also, grabs and releases <em class="parameter"><code>p</code></em>-&gt;sighand-&gt;siglock.
14</p></div><div class="refsect1"><a name="idp1107847708"></a><h2>RETURNS</h2><p>
15   0 if wait condition didn't exist and search for other wait conditions
16   should continue.  Non-zero return, -errno on failure and <em class="parameter"><code>p</code></em>'s pid on
17   success, implies that tasklist_lock is released and wait condition
18   search should terminate.
19</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s07.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch01s07.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-task-set-jobctl-pending.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Internal Functions&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">task_set_jobctl_pending</span></td></tr></table></div></body></html>
20