mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
16 lines
243 B
C
16 lines
243 B
C
|
#include <stdlib.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);
|
||
|
}
|
||
|
}
|