|
NAMEwatchdog —
hardware and software watchdog
SYNOPSIS#include <sys/watchdog.h>
DESCRIPTIONThewatchdog facility is used for controlling hardware
and software watchdogs.
The device /dev/fido supports several
optional
ioctl(2)
calls for configuration, and responds to a single operational
ioctl
call,
The To disable the watchdogs pass The optional configuration ioctl commands are listed here, along with the type of the parameter used. Examples of their use can be found in watchdogd(8).
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.
RETURN VALUESTheWDIOCPATPAT
ioctl
returns zero on success and non-zero on failure.
The configuration ioctl operations return zero on success and non-zero on failure. EXAMPLES#include <paths.h> #include <sys/watchdog.h> #define WDPATH "/dev/" _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, &timeout) == -1) err(1, "WDIOCPATPAT"); } /* in main() */ wd_init(); wd_reset(WD_ACTIVE|WD_TO_8SEC); /* potential freeze point */ wd_reset(WD_TO_NEVER); Enables a watchdog to recover from a potentially freezing piece of code. options SW_WATCHDOG 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. SEE ALSOwatchdogd(8), watchdog(9)HISTORYThewatchdog code first appeared in
FreeBSD 5.1.
AUTHORSThewatchdog facility was written by
Poul-Henning Kamp
<phk@FreeBSD.org>. The
software watchdog code and this manual page were written by
Sean Kelly
<smkelly@FreeBSD.org>.
Some contributions were made by Jeff Roberson
<jeff@FreeBSD.org>.
BUGSTheWD_PASSIVE option has not yet been implemented.
Visit the GSP FreeBSD Man Page Interface. |