1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>schedule_hrtimeout_range</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="ch01s05.html" title="High-resolution timers"><link rel="prev" href="API-hrtimer-get-res.html" title="hrtimer_get_res"><link rel="next" href="API-schedule-hrtimeout.html" title="schedule_hrtimeout"></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">schedule_hrtimeout_range</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-hrtimer-get-res.html">Prev</a> </td><th width="60%" align="center">High-resolution timers</th><td width="20%" align="right"> <a accesskey="n" href="API-schedule-hrtimeout.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-schedule-hrtimeout-range"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>schedule_hrtimeout_range — 2 sleep until timeout 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 __sched <b class="fsfunc">schedule_hrtimeout_range </b>(</code></td><td>ktime_t * <var class="pdparam">expires</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">delta</var>, </td></tr><tr><td> </td><td>const enum hrtimer_mode <var class="pdparam">mode</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1107644356"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>expires</code></em></span></dt><dd><p> 4 timeout value (ktime_t) 5 </p></dd><dt><span class="term"><em class="parameter"><code>delta</code></em></span></dt><dd><p> 6 slack in expires timeout (ktime_t) 7 </p></dd><dt><span class="term"><em class="parameter"><code>mode</code></em></span></dt><dd><p> 8 timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL 9 </p></dd></dl></div></div><div class="refsect1"><a name="idp1107648020"></a><h2>Description</h2><p> 10 Make the current task sleep until the given expiry time has 11 elapsed. The routine will return immediately unless 12 the current task state has been set (see <code class="function">set_current_state</code>). 13 </p><p> 14 15 The <em class="parameter"><code>delta</code></em> argument gives the kernel the freedom to schedule the 16 actual wakeup to a time that is both power and performance friendly. 17 The kernel give the normal best effort behavior for "<em class="parameter"><code>expires</code></em>+<em class="parameter"><code>delta</code></em>", 18 but may decide to fire the timer earlier, but no earlier than <em class="parameter"><code>expires</code></em>. 19 </p><p> 20 21 You can set the task state as follows - 22 </p><p> 23 24 <code class="constant">TASK_UNINTERRUPTIBLE</code> - at least <em class="parameter"><code>timeout</code></em> time is guaranteed to 25 pass before the routine returns. 26 </p><p> 27 28 <code class="constant">TASK_INTERRUPTIBLE</code> - the routine may return early if a signal is 29 delivered to the current task. 30 </p><p> 31 32 The current task state is guaranteed to be TASK_RUNNING when this 33 routine returns. 34 </p><p> 35 36 Returns 0 when the timer has expired otherwise -EINTR 37</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-hrtimer-get-res.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01s05.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-schedule-hrtimeout.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">hrtimer_get_res</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">schedule_hrtimeout</span></td></tr></table></div></body></html> 38