xref: /freebsd/share/man/man4/watchdog.4 (revision 2357939bc239bd5334a169b62313806178dd8f30)
1.\" Copyright (c) 2004 Poul-Henning Kamp <phk@FreeBSD.org>
2.\" Copyright (c) 2003, 2004 Sean M. Kelly <smkelly@FreeBSD.org>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD$
27.\"
28.Dd June 25, 2003
29.Dt watchdog 4
30.Os
31.Sh NAME
32.Nm watchdog
33.Nd Hardware and Software watchdog
34.Sh SYNOPSIS
35.Cd options CPU_ELAN
36.Cd options CPU_GEODE
37.Cd options SW_WATCHDOG
38.Pp
39.In sys/watchdog.h
40.Bd -literal
41
42u_int u = WD_ACTIVE | WD_8SEC;
43int fd = open("/dev/" _PATH_WATCHDOG, O_RDWR);
44
45ioctl(fd, WDIOCPATPAT, &u);
46.Ed
47.Sh DESCRIPTION
48.Nm
49is a facility for controlling hardware and software watchdog facilities.
50.Pp
51The interface is through a device named "/dev/"
52.Dv _PATH_WATCHDOG
53which
54responds to a single ioctl call,
55.Dv WDIOCPATPAT .
56.Pp
57The ioctl call takes an argument which consists of a timeout value
58specified as an integer power of two nanoseconds.
59.Pp
60The
61.Dv WD_ACTIVE
62flag signals that the watchdog will be kept from
63timing out from userland, for instance by the
64.Xr watchdogd 8
65daemon.
66.Pp
67To disable the watchdogs, use an argument of zero.
68.Pp
69The ioctl call will return success if just one of the available
70watchdog implementations support the request.
71If the ioctl fails, for instance if no watchdog supports the timeout
72length, all watchdogs are disabled and must be explicitly reenabled.
73.Sh SEE ALSO
74.Xr watchdogd 8 ,
75.Xr watchdog 9
76.Sh HISTORY
77The
78.Nm
79code first appeared in
80.Fx 5.1 .
81.Sh AUTHORS
82.An -nosplit
83The
84.Nm watchdog
85facility were written by
86.An Poul-Henning Kamp Aq phk@FreeBSD.org .
87.Pp
88The
89.Nm SW_WATCHDOG
90code and manual page were written by
91.An Sean Kelly Aq smkelly@FreeBSD.org .
92Some contributions were made by
93.An Jeff Roberson Aq jeff@FreeBSD.org .
94