Sun Microsystems Netra CP2500 Programming Manual page 22

For the solaris operating system
Table of Contents

Advertisement

System Watchdog Node Management Code Example (Continued)
CODE EXAMPLE 1-1
}
return (-1);
}
static void
print_errmsg(char *message, ...)
{
va_list ap;
va_start(ap, message);
(void) fprintf(stderr, "%s: ", prog);
(void) vfprintf(stderr, message, ap);
va_end(ap);
}
/*
* Print wdadm usage
*/
static void
usage(void)
{
print_errmsg(gettext(err_msg[EM_USAGE]));
exit(1);
}
/*
* This function is used to read picl property. The value is copied
* into vbuf.
* memory allocated for vbuf must be free'd by caller
*/
static picl_errno_t
wdadm_get_picl_prop(picl_nodehdl_t nodeh, const char *prop_name, void **vbuf)
{
picl_errno_t
picl_propinfo_t pinfo;
picl_prophdl_t
/* get the information about the property */
if ((err = picl_get_propinfo_by_name(nodeh, prop_name,
}
*vbuf = malloc(pinfo.size);
if (vbuf == NULL)
8
Netra CP2500 Board Programming Guide • March 2007
err;
proph;
&pinfo, &proph)) != PICL_SUCCESS) {
return (err);
return (PICL_NOSPACE);

Advertisement

Table of Contents
loading

Table of Contents