watchdog.c

来自「GPRS短信收发 基于linux平台」· C语言 代码 · 共 40 行

C
40
字号
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include "log.h"int openwatchdog(char * watchDogDev,char* pMod){	int fd;	if((fd=open(watchDogDev,O_RDWR|O_NONBLOCK))<=0)	{		return -1;	}	return fd;}void *feeddogthread(int *pfd){	int fd=*pfd;		//	ioctl(fd, WDIOC_SETTIMEOUT, &timeout);	writelog("feeddogthread is running\n");	/*	while(programControlConfWord->systemReboot!=1)	{		write(fd, "\0", 1);				fsync(fd);				sleep(3);	}*/}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?