aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/watchdog/watchdog-api.txt
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@xenotime.net>2006-05-21 23:58:10 -0400
committerWim Van Sebroeck <wim@iguana.be>2006-06-28 15:24:11 -0400
commit56fb9e5346b99bc6b77def79b3739097bc13ea8a (patch)
tree157e54d73ade3b65018c809a2f4109cdafeec658 /Documentation/watchdog/watchdog-api.txt
parentdfc7bd9c385a888851a2d009ba272099549f98cc (diff)
[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/watchdog-api.txt')
-rw-r--r--Documentation/watchdog/watchdog-api.txt17
1 files changed, 1 insertions, 16 deletions
diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt
index d738ec25eaa4..958ff3d48be3 100644
--- a/Documentation/watchdog/watchdog-api.txt
+++ b/Documentation/watchdog/watchdog-api.txt
@@ -34,22 +34,7 @@ activates as soon as /dev/watchdog is opened and will reboot unless
34the watchdog is pinged within a certain time, this time is called the 34the watchdog is pinged within a certain time, this time is called the
35timeout or margin. The simplest way to ping the watchdog is to write 35timeout or margin. The simplest way to ping the watchdog is to write
36some data to the device. So a very simple watchdog daemon would look 36some data to the device. So a very simple watchdog daemon would look
37like this: 37like this source file: see Documentation/watchdog/src/watchdog-simple.c
38
39#include <stdlib.h>
40#include <fcntl.h>
41
42int main(int argc, const char *argv[]) {
43 int fd=open("/dev/watchdog",O_WRONLY);
44 if (fd==-1) {
45 perror("watchdog");
46 exit(1);
47 }
48 while(1) {
49 write(fd, "\0", 1);
50 sleep(10);
51 }
52}
53 38
54A more advanced driver could for example check that a HTTP server is 39A more advanced driver could for example check that a HTTP server is
55still responding before doing the write call to ping the watchdog. 40still responding before doing the write call to ping the watchdog.