diff options
Diffstat (limited to 'Documentation/watchdog/src/watchdog-simple.c')
-rw-r--r-- | Documentation/watchdog/src/watchdog-simple.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/watchdog/src/watchdog-simple.c b/Documentation/watchdog/src/watchdog-simple.c new file mode 100644 index 000000000000..85cf17c48669 --- /dev/null +++ b/Documentation/watchdog/src/watchdog-simple.c | |||
@@ -0,0 +1,15 @@ | |||
1 | #include <stdlib.h> | ||
2 | #include <fcntl.h> | ||
3 | |||
4 | int main(int argc, const char *argv[]) { | ||
5 | int fd = open("/dev/watchdog", O_WRONLY); | ||
6 | if (fd == -1) { | ||
7 | perror("watchdog"); | ||
8 | exit(1); | ||
9 | } | ||
10 | while (1) { | ||
11 | write(fd, "\0", 1); | ||
12 | fsync(fd); | ||
13 | sleep(10); | ||
14 | } | ||
15 | } | ||