summaryrefslogtreecommitdiff
path: root/Documentation/watchdog/src/watchdog-simple.c
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@xenotime.net>2006-05-21 20:58:10 -0700
committerWim Van Sebroeck <wim@iguana.be>2006-06-28 21:24:11 +0200
commit56fb9e5346b99bc6b77def79b3739097bc13ea8a (patch)
tree157e54d73ade3b65018c809a2f4109cdafeec658 /Documentation/watchdog/src/watchdog-simple.c
parentdfc7bd9c385a888851a2d009ba272099549f98cc (diff)
downloadlwn-56fb9e5346b99bc6b77def79b3739097bc13ea8a.tar.gz
lwn-56fb9e5346b99bc6b77def79b3739097bc13ea8a.zip
[WATCHDOG] Documentation/watchdog update
Documentation/watchdog/: Expose example and tool source files in the Documentation/ directory in their own files instead of being buried (almost hidden) in readme/txt files. This will make them more visible/usable to users who may need to use them, to developers who may need to test with them, and to janitors who would update them if they were more visible. Also, if any of these possibly should not be in the kernel tree at all, it will be clearer that they are here and we can discuss if they should be removed. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'Documentation/watchdog/src/watchdog-simple.c')
-rw-r--r--Documentation/watchdog/src/watchdog-simple.c15
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 @@
+#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);
+ }
+}