---
name: "watchdog"
section: "4"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd", "openbsd"]
url: "https://new.carta.tech/watchdog/4"
---

# watchdog(4)

hardware and software watchdog

## NAME

**watchdog** – hardware and software watchdog

## SYNOPSIS

**options CPU\_ELAN** **options CPU\_GEODE** **options SW\_WATCHDOG**

**#include \<sys/watchdog.h\>**

## DESCRIPTION

The **watchdog** facility is used for controlling hardware and software watchdogs.

The interface is through a device named "/dev/" \_PATH\_WATCHDOG which responds to a single [ioctl(2)](/ioctl/2.md) call, WDIOCPATPAT.

The call takes a single argument which represents a timeout value specified as an integer power of two nanoseconds.

The WD\_ACTIVE flag signals that the **watchdog** will be kept from timing out from userland, for instance by the [watchdogd(8)](/watchdogd/8.md) daemon.

To disable the watchdogs, an argument of zero should be used.

The [ioctl(2)](/ioctl/2.md) call will return success if just one of the available [watchdog(9)](/watchdog/9.md) implementations support the request. If the call fails, for instance if none of [watchdog(9)](/watchdog/9.md) implementations support the timeout length, all watchdogs are disabled and must be explicitly re-enabled.

## EXAMPLES

```
u_int u = WD_ACTIVE | WD_TO_8SEC;
int fd = open("/dev/" _PATH_WATCHDOG, O_RDWR);
ioctl(fd, WDIOCPATPAT, &u);
```

## SEE ALSO

[watchdogd(8)](/watchdogd/8.md), [watchdog(9)](/watchdog/9.md)

## HISTORY

The **watchdog** code first appeared in FreeBSD 5.1.

## AUTHORS

The **watchdog** 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⟩.
