EasyManuals Logo

Sun Microsystems Netra T2000 User Manual

Sun Microsystems Netra T2000
122 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #107 background imageLoading...
Page #107 background image
Appendix A Watchdog Timer Application Mode 91
Example Watchdog Program
Following is a sample program for the watchdog timer.
CODE EXAMPLE A-2 Watchdog and Reset Control Data Structure
typedef struct {
int reset_enable; /* reset enabled if non-zero */
int dog_enable; /* watchdog enabled if non-zero */
} lom_dogctl_t;
CODE EXAMPLE A-3 Example Watchdog Program
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <lom_io.h>
int main() {
uint_t timeout = 30; /* 30 seconds */
lom_dogctl_t dogctl;
int fd;
dogctl.reset_enable = 1;
dogctl.dog_enable = 1;
fd = open("/dev/ntwdt", O_EXCL);
/* Set timeout */
ioctl(fd, LOMIOCDOGTIME, (void *)&timeout);
/* Enable watchdog */
ioctl(fd, LOMIOCDOGCTL, (void *)&dogctl);
/* Keep patting */
while (1) {
ioctl(fd, LOMIOCDOGPAT, NULL);
sleep (5);
}
return (0);
}

Table of Contents

Other manuals for Sun Microsystems Netra T2000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sun Microsystems Netra T2000 and is the answer not in the manual?

Sun Microsystems Netra T2000 Specifications

General IconGeneral
BrandSun Microsystems
ModelNetra T2000
CategoryServer
LanguageEnglish

Related product manuals