Sun Microsystems Netra CP2500 Programming Manual page 21

For the solaris operating system
Table of Contents

Advertisement

System Watchdog Node Management Code Example (Continued)
CODE EXAMPLE 1-1
#define WATCHDOG_DISARMED
/*
* data structure that will be passed as argument to
* picl_walk_tree_by_class callback function
*/
typedef struct {
int start_index;
int max_index;
char
char
char
char
int32_t timeout;
int
} wdadm_args_t;
static
char
static picl_nodehdl_t
static
/*
* Error mesage texts
*/
static
char
/* program usage */
USAGE_STR,
/* picl call failed messages */
"picl_initialize failed: %s\n",
"picl_get_root failed: %s\n",
"picl_get_propval_by_name failed: %s\n"
};
#define NUM_ERROR_CODES 7
/* mapping between picl error codes and errno */
static int error_map[][2] =
{PICL_SUCCESS, 0}, { PICL_FAILURE, -1}, {PICL_VALUETOOBIG, E2BIG},
{PICL_NODENOTFOUND, ENODEV}, {PICL_PERMDENIED, EPERM},
{PICL_NOSPACE, ENOMEM}, {PICL_INVALIDARG, EINVAL} };
static int
picl2errno(int piclerr)
{
int i;
for (i = 0; i < NUM_ERROR_CODES; i++) {
**list;
*name;
*action;
*op;
error_code;
*prog;
rooth;
int count = 0;
*err_msg[] = {
{
if (error_map[i][0] == piclerr)
return (error_map[i][1]);
"disarmed"
/* 0 */
/*
1 */
/*
2 */
/*
3 */
Chapter 1 Watchdog Timer
7

Advertisement

Table of Contents
loading

Table of Contents