beautypg.com

Watchdog node management code, Code example 1-1 – Sun Microsystems Netra CP2500 User Manual

Page 19

background image

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

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

/*

* Error codes

*/

#define EM_USAGE 0