linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / Documentation / watchdog / watchdog.txt
index 4b1ff69..dffda29 100644 (file)
@@ -65,7 +65,28 @@ The external event interfaces on the WDT boards are not currently supported.
 Minor numbers are however allocated for it.
 
 
-Example Watchdog Driver:  see Documentation/watchdog/src/watchdog-simple.c
+Example Watchdog Driver
+-----------------------
+
+#include <stdio.h>
+#include <unistd.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);
+       }
+}
 
 
 Contact Information