summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/watchdog.4 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man4/watchdog.4 3.html')
-rw-r--r--static/freebsd/man4/watchdog.4 3.html186
1 files changed, 186 insertions, 0 deletions
diff --git a/static/freebsd/man4/watchdog.4 3.html b/static/freebsd/man4/watchdog.4 3.html
new file mode 100644
index 00000000..4449d3c3
--- /dev/null
+++ b/static/freebsd/man4/watchdog.4 3.html
@@ -0,0 +1,186 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">WATCHDOG(4)</td>
+ <td class="head-vol">Device Drivers Manual</td>
+ <td class="head-rtitle">WATCHDOG(4)</td>
+ </tr>
+</table>
+<div class="manual-text">
+<section class="Sh">
+<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
+<p class="Pp"><code class="Nm">watchdog</code> &#x2014;
+ <span class="Nd">hardware and software watchdog</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
+<p class="Pp"><code class="In">#include
+ &lt;<a class="In">sys/watchdog.h</a>&gt;</code></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
+<p class="Pp">The <code class="Nm">watchdog</code> facility is used for
+ controlling hardware and software watchdogs.</p>
+<p class="Pp">The device <span class="Pa">/dev/fido</span> supports several
+ optional <a class="Xr">ioctl(2)</a> calls for configuration, and responds to
+ a set of operational <a class="Xr">ioctl(2)</a> calls:</p>
+<dl class="Bl-tag">
+ <dt id="WDIOCPATPAT"><a class="permalink" href="#WDIOCPATPAT"><code class="Dv">WDIOCPATPAT</code></a></dt>
+ <dd>Pat the watchdog.</dd>
+ <dt id="WDIOC_CONTROL"><a class="permalink" href="#WDIOC_CONTROL"><code class="Dv">WDIOC_CONTROL</code></a></dt>
+ <dd>Enable, disable, or reset the watchdog.</dd>
+</dl>
+<p class="Pp">The <code class="Dv">WDIOCPATPAT</code> <a class="Xr">ioctl(2)</a>
+ call takes a single argument which represents a timeout value specified as a
+ <var class="Vt">sbintime_t</var> of the timeout period for the watchdog.</p>
+<p class="Pp">The <code class="Dv">WDIOCPATPAT</code> <a class="Xr">ioctl(2)</a>
+ call will return success if just one of the available
+ <a class="Xr">watchdog(9)</a> implementations supports setting the timeout
+ to the specified timeout. This means that at least one watchdog is armed. By
+ default, this will be a hardware watchdog if one is present, but if no
+ hardware watchdog is able to process the request, a default software
+ watchdog is enabled. If the call fails, for instance if none of
+ <a class="Xr">watchdog(9)</a> implementations support the timeout length,
+ all watchdogs are disabled and must be explicitly re-enabled.</p>
+<p class="Pp">To disable the watchdogs use the
+ <code class="Dv">WDIOC_CONTROL</code> <a class="Xr">ioctl(2)</a> call with
+ the <code class="Dv">WD_CTRL_DISABLE</code> flag. If disarming the
+ watchdog(s) failed an error is returned. The watchdog might still be armed!
+ To reenable the watchdogs use the <code class="Dv">WDIOC_CONTROL</code>
+ <a class="Xr">ioctl(2)</a> call with the
+ <code class="Dv">WD_CTRL_ENABLE</code> flag. Another way to pat the watchdog
+ is with the <code class="Dv">WDIOC_CONTROL</code> <a class="Xr">ioctl(2)</a>
+ call passing the <code class="Dv">WDIOC_CTRL_RESET</code> flag.</p>
+<p class="Pp">The optional configuration <a class="Xr">ioctl(2)</a> commands are
+ listed here, along with the type of the parameter used. Examples of their
+ use can be found in <a class="Xr">watchdogd(8)</a>.</p>
+<dl class="Bl-tag">
+ <dt id="WDIOC_SETTIMEOUT"><a class="permalink" href="#WDIOC_SETTIMEOUT"><code class="Dv">WDIOC_SETTIMEOUT</code></a>
+ <var class="Fa">sbintime_t</var></dt>
+ <dd>set/reset the timer</dd>
+ <dt id="WDIOC_GETTIMEOUT"><a class="permalink" href="#WDIOC_GETTIMEOUT"><code class="Dv">WDIOC_GETTIMEOUT</code></a>
+ <var class="Fa">sbintime_t</var></dt>
+ <dd>get total timeout</dd>
+ <dt id="WDIOC_GETTIMELEFT"><a class="permalink" href="#WDIOC_GETTIMELEFT"><code class="Dv">WDIOC_GETTIMELEFT</code></a>
+ <var class="Fa">sbintime_t</var></dt>
+ <dd>get time left</dd>
+ <dt id="WDIOC_GETPRETIMEOUT"><a class="permalink" href="#WDIOC_GETPRETIMEOUT"><code class="Dv">WDIOC_GETPRETIMEOUT</code></a>
+ <var class="Fa">sbintime_t</var></dt>
+ <dd>get the pre-timeout</dd>
+ <dt id="WDIOC_SETPRETIMEOUT"><a class="permalink" href="#WDIOC_SETPRETIMEOUT"><code class="Dv">WDIOC_SETPRETIMEOUT</code></a>
+ <var class="Fa">sbintime_t</var></dt>
+ <dd>set the pre-timeout</dd>
+ <dt id="WDIOC_SETPRETIMEOUTACT"><a class="permalink" href="#WDIOC_SETPRETIMEOUTACT"><code class="Dv">WDIOC_SETPRETIMEOUTACT</code></a>
+ <var class="Fa">int</var></dt>
+ <dd>Set the action when a pre-timeout occurs (see
+ <code class="Li">WD_SOFT_*</code> below).</dd>
+ <dt id="WDIOC_SETSOFT"><a class="permalink" href="#WDIOC_SETSOFT"><code class="Dv">WDIOC_SETSOFT</code></a>
+ <var class="Fa">int</var></dt>
+ <dd>Use an internal software watchdog instead of hardware. There is also an
+ external software watchdog, which is used by default if no hardware
+ watchdog was attached.</dd>
+ <dt id="WDIOC_SETSOFTTIMEOUTACT"><a class="permalink" href="#WDIOC_SETSOFTTIMEOUTACT"><code class="Dv">WDIOC_SETSOFTTIMEOUTACT</code></a>
+ <var class="Fa">int</var></dt>
+ <dd>Set the action when a soft timeout occurs.</dd>
+</dl>
+<p class="Pp">The actions that may be specified for the pre-timeout or the
+ internal software watchdog are listed here. Multiple actions can be
+ specified by ORing values together.</p>
+<dl class="Bl-tag">
+ <dt id="WD_SOFT_PANIC"><a class="permalink" href="#WD_SOFT_PANIC"><code class="Dv">WD_SOFT_PANIC</code></a></dt>
+ <dd>panic</dd>
+ <dt id="WD_SOFT_DDB"><a class="permalink" href="#WD_SOFT_DDB"><code class="Dv">WD_SOFT_DDB</code></a></dt>
+ <dd>enter debugger</dd>
+ <dt id="WD_SOFT_LOG"><a class="permalink" href="#WD_SOFT_LOG"><code class="Dv">WD_SOFT_LOG</code></a></dt>
+ <dd>log(9)</dd>
+ <dt id="WD_SOFT_PRINT"><a class="permalink" href="#WD_SOFT_PRINT"><code class="Dv">WD_SOFT_PRINT</code></a></dt>
+ <dd>printf(9)</dd>
+</dl>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
+ VALUES</a></h1>
+<p class="Pp">The <code class="Dv">WDIOCPATPAT</code> <a class="Xr">ioctl(2)</a>
+ returns zero on success and non-zero on failure.</p>
+<dl class="Bl-tag">
+ <dt>[<code class="Er">EOPNOTSUPP</code>]</dt>
+ <dd>No watchdog present in the kernel or none of the watchdogs supports the
+ requested timeout value (timeout value other than 0).</dd>
+ <dt>[<code class="Er">EOPNOTSUPP</code>]</dt>
+ <dd>Watchdog could not be disabled (timeout value of 0).</dd>
+ <dt>[<code class="Er">EINVAL</code>]</dt>
+ <dd>Invalid flag combination passed.</dd>
+</dl>
+<p class="Pp">The configuration <a class="Xr">ioctl(2)</a> operations return
+ zero on success and non-zero on failure.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
+<div class="Bd Bd-indent Li">
+<pre>#include &lt;paths.h&gt;
+#include &lt;sys/watchdog.h&gt;
+
+#define WDPATH &quot;/dev/&quot; _PATH_WATCHDOG
+int wdfd = -1;
+
+static void
+wd_init(void)
+{
+ wdfd = open(WDPATH, O_RDWR);
+ if (wdfd == -1)
+ err(1, WDPATH);
+}
+static void
+wd_reset(u_int timeout)
+{
+ if (ioctl(wdfd, WDIOCPATPAT, &amp;timeout) == -1)
+ err(1, &quot;WDIOCPATPAT&quot;);
+}
+
+/* in main() */
+wd_init();
+wd_reset(WD_ACTIVE|WD_TO_8SEC);
+/* potential freeze point */
+wd_reset(WD_TO_NEVER);</pre>
+</div>
+<p class="Pp">Enables a watchdog to recover from a potentially freezing piece of
+ code.</p>
+<p class="Pp"></p>
+<div class="Bd Bd-indent"><code class="Li">options SW_WATCHDOG</code></div>
+<p class="Pp">in your kernel config forces a software watchdog in the kernel to
+ be configured even if a hardware watchdog is configured, dropping to KDB or
+ panicking when firing, depending on the KDB and KDB_UNATTENDED kernel
+ configuration options.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
+ ALSO</a></h1>
+<p class="Pp"><a class="Xr">watchdogd(8)</a>, <a class="Xr">watchdog(9)</a></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
+<p class="Pp">The <code class="Nm">watchdog</code> code first appeared in
+ <span class="Ux">FreeBSD 5.1</span>.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
+<p class="Pp">The <code class="Nm">watchdog</code> facility was written by
+ <span class="An">Poul-Henning Kamp</span>
+ &lt;<a class="Mt" href="mailto:phk@FreeBSD.org">phk@FreeBSD.org</a>&gt;. The
+ software watchdog code and this manual page were written by
+ <span class="An">Sean Kelly</span>
+ &lt;<a class="Mt" href="mailto:smkelly@FreeBSD.org">smkelly@FreeBSD.org</a>&gt;.
+ Some contributions were made by <span class="An">Jeff Roberson</span>
+ &lt;<a class="Mt" href="mailto:jeff@FreeBSD.org">jeff@FreeBSD.org</a>&gt;.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
+<p class="Pp">The <code class="Dv">WD_PASSIVE</code> option has not yet been
+ implemented.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">January 2, 2018</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>