/*
* 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 usr/src/OPENSOLARIS.LICENSE
* 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 usr/src/OPENSOLARIS.LICENSE.
* 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
*/
/*
*/
#include <alloca.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <strings.h>
#include "asr_err.h"
/*
* Gets the default error string for the given errno.
*/
switch (err) {
case EASR_NONE:
return ("no error");
case EASR_NOMEM:
return ("no memory");
case EASR_USAGE:
return ("option processing error");
case EASR_UNKNOWN:
return ("an internal error occured");
case EASR_UNSUPPORTED:
return ("unsupported operation");
case EASR_ZEROSIZE:
return ("caller attempted zero-length allocation");
case EASR_OVERSIZE:
return ("program attempted to allocate to much data");
case EASR_NULLDATA:
return ("program attempted to operate on NULL data");
case EASR_NULLFREE:
return ("caller attempted to free NULL handle");
case EASR_MD_NODATA:
return ("failed to open metadata");
case EASR_PROP_USAGE:
return ("property keyword syntax error");
case EASR_PROP_NOPROP:
return ("no such property name");
case EASR_PROP_SET:
return ("unable to set property");
case EASR_SC:
return ("error during phone home");
case EASR_SC_RESOLV_PROXY:
return ("error resolving proxy");
case EASR_SC_RESOLV_HOST:
return ("error resolving host");
case EASR_SC_CONN:
return ("error connecting to support service");
case EASR_SC_AUTH:
case EASR_SC_REG:
return ("service not registered");
case EASR_FM:
return ("FM module error");
case EASR_TOPO:
return ("failed to determine system topology");
case EASR_SCF:
return ("SCF library error");
case EASR_SSL_LIBSSL:
return ("SSL library error");
default:
return ("ERROR");
}
}
{
return (asr_errno);
}
/*
* Sets the ASR errno
*/
int
{
_asr_errmsg[0] = '\0';
return (err);
}
/*
* Sets the ASR errno and sets a custom error message.
*/
int
{
size_t n;
char *errmsg;
(void) asr_set_errno(err);
return (err);
}
/*
* Sets the ASR errno and sets a custom error message.
*/
/*PRINTFLIKE2*/
int
{
return (asr_set_errno(err));
return (err);
}
/*
* Gets the current error message.
*/
const char *
{
if (_asr_errmsg[0] == '\0') {
(void) strlcpy(_asr_errmsg,
}
return (_asr_errmsg);
}