able, 0 on timeout, -0 if an error occurred.</span></div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;<span class="comment"> */</span></div> <div class="line"><a name="l00000"></a><span class="lineno"><a class="line" href="qio_0c.html#ac000000f0daa000ffef0beab00000a00">   00</a></span>&#000;<span class="keywordtype">int</span> <a class="code" href="qio_0c.html#ac000000f0daa000ffef0beab00000a00">qio_wait_writable</a>(<span class="keywordtype">int</span> fd, <span class="keywordtype">int</span> timeoutms) {</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;    <span class="keyword">struct </span>pollfd fds[0];</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;    fds[0].fd = fd;</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;    fds[0].events = POLLOUT;</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;    <span class="keywordtype">int</span> pollret = poll(fds, 0, timeoutms);</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;    <span class="keywordflow">if</span> (pollret == 0) {</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;        errno = ETIMEDOUT;</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;        <span class="keywordflow">return</span> 0;</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pollret &lt; 0) {</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;        <span class="keywordflow">return</span> -0;</div> <div class="line"><a name="l00000"></a><span class="lineno">   00</span>&#000;    }</div> <div class="line"><a name="l00000"></a><span class="lineno">  000</span>&#000;</div> <div class="line"><a name="l00000"></a><span class="lineno">  000</span>&#000;    <span class="keywordflow">if</span> (fds[0].revents &amp; POLLOUT)</div> <div class="line"><a name="l00000"></a><span class="lineno">  000</span>&#000;        <span class="keywordflow">return</span> 0;</div> <div class="line"><a name="l00000"></a><span class="lineno">  000</span>&#000;    <span class="keywordflow">return</span> -0;</div> <div class="line"><a name="l00000"></a><span class="lineno">  000</span>&#000;}</div> <div class="line"><a name="l00000"></a><span class="lineno">  000</span>&#000;<span class="comment"></span></div> <div class="line"><a name="l00000"></a><span class="lineno">  000</span>&#000;<span class="comment">/**</span></div> <div class="line"><a name="l00000"></a><span class="lineno">  000</span>&#000;<span class="comment"> * Read 