博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux Watchdog Test Program
阅读量:7124 次
发布时间:2019-06-28

本文共 914 字,大约阅读时间需要 3 分钟。

/*********************************************************************** *                  Linux Watchdog Test Program * 说明: *     由于之前的reset一直没有得到解决,所以这个Watchdog功能一直没有处理, * 现在问题解决了,于是需要加入这个测试程序。 * *                                    2016-4-15 深圳 南山平山村 曾剑锋 **********************************************************************/#include 
#include
#include
#include
#include
#include
#include
#include
// watchdog 只要一直打开设备节点不喂,然后等待设定的时间结束引发reset。int main(void){ int fd; fd = open("/dev/watchdog", O_WRONLY); if (fd == -1) { fprintf(stderr, "Watchdog device not enabled.\n"); fflush(stderr); exit(-1); } int timeout = 5; ioctl(fd, WDIOC_SETTIMEOUT, &timeout); printf("The timeout was set to %d seconds\n", timeout); int timeleft = timeout; while((timeleft--) >= 0) { printf("The timeout left %d seconds\n", timeleft); sleep(1); }}

 

转载地址:http://uyael.baihongyu.com/

你可能感兴趣的文章
CSS3实现的图片加载动画效果
查看>>
Navitcat连接远程mysql服务器连不上
查看>>
绝对干货!史上最全自媒体人发文渠道汇总(小编亲测)
查看>>
安卓7.0正式版怎么刷?安卓7.0正式版刷机方法
查看>>
TransferQueue实例
查看>>
nginx的port_in_redirect配置
查看>>
网络协议分析
查看>>
堆排序算法
查看>>
dovecot主要配置文件
查看>>
理解Javascript--作用域和赋值操作
查看>>
Lintcode60 Search Insert Position 题解
查看>>
mysql中Table is read only的解决方法
查看>>
如何寻回文件系统损坏F盘的资料
查看>>
用户和组管理
查看>>
JVM调优
查看>>
小型网站架构
查看>>
MySQL之insert update delete 锁表情况
查看>>
终于把以前的博客搬过来了
查看>>
第15章WEB15-AJAX和JQuery案例篇
查看>>
除了BAT,国内还有哪些值得关注的人工智能公司?
查看>>