| Jean Delvare | 2db02c0 | 2006-09-28 09:35:27 +0200 | [diff] [blame] | 1 | #include <stdio.h> | 
| Randy Dunlap | 56fb9e5 | 2006-05-21 20:58:10 -0700 | [diff] [blame] | 2 | #include <stdlib.h> | 
| Jean Delvare | 2db02c0 | 2006-09-28 09:35:27 +0200 | [diff] [blame] | 3 | #include <unistd.h> | 
| Randy Dunlap | 56fb9e5 | 2006-05-21 20:58:10 -0700 | [diff] [blame] | 4 | #include <fcntl.h> | 
|  | 5 |  | 
|  | 6 | int main(int argc, const char *argv[]) { | 
|  | 7 | int fd = open("/dev/watchdog", O_WRONLY); | 
|  | 8 | if (fd == -1) { | 
|  | 9 | perror("watchdog"); | 
|  | 10 | exit(1); | 
|  | 11 | } | 
|  | 12 | while (1) { | 
|  | 13 | write(fd, "\0", 1); | 
|  | 14 | fsync(fd); | 
|  | 15 | sleep(10); | 
|  | 16 | } | 
|  | 17 | } |