X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Documentation%2Fwatchdog%2Fsrc%2Fwatchdog-simple.c;fp=Documentation%2Fwatchdog%2Fsrc%2Fwatchdog-simple.c;h=85cf17c48669d73111ff14ae8490417425da7030;hb=f05f9504c50ed069377d37f02f22e7a16b5921de;hp=0000000000000000000000000000000000000000;hpb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;p=linux-2.6.git diff --git a/Documentation/watchdog/src/watchdog-simple.c b/Documentation/watchdog/src/watchdog-simple.c new file mode 100644 index 000000000..85cf17c48 --- /dev/null +++ b/Documentation/watchdog/src/watchdog-simple.c @@ -0,0 +1,15 @@ +#include +#include + +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); + } +}