Home | History | Annotate | Download | only in man3ha
 te
CDDL HEADER START

The contents of this file are subject to the terms of the
Common Development and Distribution License (the "License").
You may not use this file except in compliance with the License.

You can obtain a copy of the license at CDDL.txt
or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions
and limitations under the License.

When distributing Covered Code, include this CDDL HEADER in each
file and include the License file at CDDL.txt.
If applicable, add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your own identifying
information: Portions Copyright [yyyy] [name of copyright owner]

CDDL HEADER END
Copyright 2007 Sun Microsystems, Inc. All rights
reserved. Use is subject to license terms.
scha_strerror 3HA "7 Sep 2007" "Sun Cluster 3.2" "Sun Cluster HA and Data Services"
NAME
scha_strerror, scha_strerror_i18n - generate error message from error code
SYNOPSIS

cc [flags.\|.\|.] -I /usr/cluster/include file -L /usr/cluster/lib  -l  scha
#include <scha.h>

char *scha_strerror(scha_err_t error_code);

char *scha_strerror_i18n(scha_err_t error_code);
DESCRIPTION

The scha_strerror() and scha_strerror_i18n() functions generate a short string that describes the error from the given scha_err_t error code. Strings that are returned by scha_strerror() are displayed in English. Strings that are returned by scha_strerror_i18n() are displayed in the native language that is specified by the LC_MESSAGES locale category. See setlocale(3C).

PARAMETERS

The following parameters are supported:

.na error_code .ad Error code from which the short string that describes the error is generated.

EXAMPLES

Example 1 Using the scha_strerror_i18n() Function

sample()
{
 scha_err_t err;

 /* resource group containing example_R */
 char * resource_group = "example_RG";

 /* a configured resource */
 char * resource_name = "example_R";

 err = scha_control(SCHA_GIVEOVER, resource_group, resource_name);

 if (err != SCHA_ERR_NOERR) {
 syslog(LOG_ERR, "scha_control GIVEOVER failed: %s", 
 scha_strerror_i18n(err));
 }
}
FILES

.na /usr/cluster/include/scha.h .ad Include file

.na /usr/cluster/lib/libscha.so .ad Library

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWscdev
Interface StabilityEvolving
SEE ALSO

scha_calls(3HA), setlocale(3C), syslog(3C), attributes(5)