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

Linux Watchdog Test Program的更多相关文章

  1. linux watchdog demo hacking

    /********************************************************************** * linux watchdog demo hackin ...

  2. Linux watchdog

    使用 watchdog 构建高可用性的 Linux 系统及应用https://www.ibm.com/developerworks/cn/linux/l-cn-watchdog/index.html ...

  3. Linux watchdog 关闭退出功能

    Linux 程序退出的时候,程序是会把 watchdog 调用 release 功能.

  4. Linux watchdog 6300esb

     基本原理: Linux 自带了一个 watchdog 的实现,用于监视系统的执行,包含一个内核 watchdog module 和一个用户空间的 watchdog 程序.内核 watchdog ...

  5. 基于S3C2440的嵌入式Linux驱动——看门狗(watchdog)驱动解读

    本文将介绍看门狗驱动的实现. 目标平台:TQ2440 CPU:s3c2440 内核版本:2.6.30 1. 看门狗概述 看门狗其实就是一个定时器,当该定时器溢出前必须对看门狗进行"喂狗“,如 ...

  6. am335x watchdog

    am335x watchdog 内核文档kernel/Documentation/watchdog Qt@aplex:~/kernel/7109/linux-3.2.0/Documentation/w ...

  7. watchdog机制

    转自:http://blog.sina.com.cn/s/blog_4dff871201012yzh.html 什么是Watchdog? Watchdog,又称watchdog timer,是计算机可 ...

  8. Qt 控制watchdog app hacking

    /************************************************************************** * Qt 控制watchdog app hack ...

  9. xrdp远程 & watchdog 启用与测试 & WebRTC

    sudo apt-get install xrdp sudo apt-get install vnc4server tightvncserver echo "xfce4-session&qu ...

随机推荐

  1. SVN--从本地检出项目至服务器报错--禁止访问

    错误描述: 原因:这是访问权限限制引起的. 查看/svn/test目录的权限--之前我修改过的 现在添加一个user就好了--这个添加的developer是我之前导入本地项目时已经验证过的,所以再导入 ...

  2. Atmel Studio 6.0新建项目

        使用Atmel Studio 6.0新建一个项目 连接Atmel 开发板与调试板,开发板使用的芯片是ATXMGEA128A1 注意: 以上对于开发板与调试板的连接,需要非常注意连接时线的方向, ...

  3. Spring3+hibernate4+struts2整合的 过程中发生如下错误

    严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderLis ...

  4. UI框架说明

    JQueryEasyUI jQuery EasyUI是一组基于jQuery的UI插件集合,而jQuery EasyUI的目标就是帮助web开发者更轻松的打造出功能丰富并且美观的UI界面.开发者不需要编 ...

  5. EXCEL,熟悉又不熟悉的项目管理工具

    EXCEL,熟悉又不熟悉的项目管理工具 如何利用excel做轻量级的项目管理 教你用Excel进行项目管理

  6. C#中Hashtable容器的了解与使用

    初涉Hashtable寄语 由于近段时间培训内容涉及到Hashtable方面的知识,由于培训仅仅起到一个引导的作用,加之以前又接触得少,因此对Hashtable这个东东蛮陌生,呵呵,今晚木有事儿就一起 ...

  7. gcd 最大公约数 模版!

    1: #define ll long long ll gcd(ll a,ll b) { ) { return b; }else { return gcd(b % a,a); } } 2: int64 ...

  8. 移动开发之meta篇

    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable= ...

  9. 2010年山东省第一届ACM大学生程序设计竞赛 Balloons (BFS)

    题意 : 找联通块的个数,Saya定义两个相连是 |xa-xb| + |ya-yb| ≤ 1 ,但是Kudo定义的相连是 |xa-xb|≤1 并且 |ya-yb|≤1.输出按照两种方式数的联通块的各数 ...

  10. 简单易懂的现代魔法——Play Framework攻略2

    接前文:http://www.cnblogs.com/Kassadin/p/4335908.html 上次讲到Play Framework开发环境的配置,以及第一个Hello World程序:本次主要 ...