This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / Documentation / watchdog / src / watchdog-simple.c
diff --git a/Documentation/watchdog/src/watchdog-simple.c b/Documentation/watchdog/src/watchdog-simple.c
new file mode 100644 (file)
index 0000000..85cf17c
--- /dev/null
@@ -0,0 +1,15 @@
+#include <stdlib.h>
+#include <fcntl.h>
+
+int main(int argc, const char *argv[]) {
+       int fd = open("/dev/watchdog", O_WRONLY);
+       if (fd == -1) {
+               perror("watchdog");
+               exit(1);
+       }
+       while (1) {
+               write(fd, "\0", 1);
+               fsync(fd);
+               sleep(10);
+       }
+}