diff options
Diffstat (limited to 'Documentation/watchdog/watchdog.txt')
-rw-r--r-- | Documentation/watchdog/watchdog.txt | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/Documentation/watchdog/watchdog.txt b/Documentation/watchdog/watchdog.txt index dffda29c8799..4b1ff69cc19a 100644 --- a/Documentation/watchdog/watchdog.txt +++ b/Documentation/watchdog/watchdog.txt | |||
@@ -65,28 +65,7 @@ The external event interfaces on the WDT boards are not currently supported. | |||
65 | Minor numbers are however allocated for it. | 65 | Minor numbers are however allocated for it. |
66 | 66 | ||
67 | 67 | ||
68 | Example Watchdog Driver | 68 | Example Watchdog Driver: see Documentation/watchdog/src/watchdog-simple.c |
69 | ----------------------- | ||
70 | |||
71 | #include <stdio.h> | ||
72 | #include <unistd.h> | ||
73 | #include <fcntl.h> | ||
74 | |||
75 | int main(int argc, const char *argv[]) | ||
76 | { | ||
77 | int fd=open("/dev/watchdog",O_WRONLY); | ||
78 | if(fd==-1) | ||
79 | { | ||
80 | perror("watchdog"); | ||
81 | exit(1); | ||
82 | } | ||
83 | while(1) | ||
84 | { | ||
85 | write(fd,"\0",1); | ||
86 | fsync(fd); | ||
87 | sleep(10); | ||
88 | } | ||
89 | } | ||
90 | 69 | ||
91 | 70 | ||
92 | Contact Information | 71 | Contact Information |