QT里面用到看门狗,我会定时喂狗,但有时候我想停止看门狗。
打开看门狗
fd_dog = open("/dev/watchdog", O_RDWR);
printf("fd_dog is open");
if (fd_dog<0)
{
printf("Error: open watchdog error.\n");
exit(1);
}
我试了两个方法,
1 char a='V'; //看门狗底层驱动 里面如果写入V 会停止
::write(fd_dog,&a, 1);
看门狗还是没用关闭
? 不知道咋回事?
2 release(fd_dog) 编译器提示 release 没声明 具体怎么用?
看门狗的底层驱动操作结构如下
static const struct file_operations s3c2410wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = s3c2410wdt_write,
.unlocked_ioctl = s3c2410wdt_ioctl,
.open = s3c2410wdt_open,
.release = s3c2410wdt_release,
};