Sun Microsystems CP2500 Computer Hardware User Manual


 
Chapter 1 Watchdog Timer 5
Watchdog Node Management Code
CODE EXAMPLE 1-1 contains an example of the code used for managing the watchdog
timer nodes. This code can be used to change watchdog timer action and timeout
values and also to arm and disarm the watchdog controller.
:_class watchdog-timer
:name watchdog-level2
CODE EXAMPLE 1-1 System Watchdog Node Management Code Example
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "@(#)wdadm.c 1.6 03/10/16 SMI"
/*
* This program is used to manage the system watchdog nodes.
* Please refer to libpicl(3LIB) for information on picl APIs
* To compile:
* cc -o wdadm -lpicl wdadm.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <alloca.h>
#include <libintl.h>
#include <locale.h>
#include <unistd.h>
#include <assert.h>
#include <inttypes.h>
#include <sys/termios.h>
#include <picl.h>
/*
* Error codes
*/
#define EM_USAGE 0