/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
*/
/*
* Copyright (c) 1994, by Sun Microsytems, Inc.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Error code manipulation routines
*/
#include <string.h>
#include <libintl.h>
#include <errno.h>
#include "tnfctl_int.h"
#include "dbg.h"
#if !defined(TEXT_DOMAIN)
#endif
/*
* tnfctl_strerror() - this routine returns a pointer to a static string
* describing the error argument.
*/
const char *
{
switch (prexstat) {
case TNFCTL_ERR_NONE:
case TNFCTL_ERR_ACCES:
case TNFCTL_ERR_NOTARGET:
case TNFCTL_ERR_ALLOCFAIL:
case TNFCTL_ERR_INTERNAL:
case TNFCTL_ERR_SIZETOOSMALL:
case TNFCTL_ERR_SIZETOOBIG:
case TNFCTL_ERR_BADARG:
case TNFCTL_ERR_NOTDYNAMIC:
case TNFCTL_ERR_NOLIBTNFPROBE:
return (dgettext(TEXT_DOMAIN,
"No libtnfprobe linked in target"));
case TNFCTL_ERR_BUFEXISTS:
case TNFCTL_ERR_NOBUF:
case TNFCTL_ERR_BADDEALLOC:
"tracing is active"));
case TNFCTL_ERR_NOPROCESS:
case TNFCTL_ERR_FILENOTFOUND:
case TNFCTL_ERR_BUSY:
return (dgettext(TEXT_DOMAIN,
"Device busy - kernel or process already tracing"));
case TNFCTL_ERR_INVALIDPROBE:
case TNFCTL_ERR_USR1:
case TNFCTL_ERR_USR2:
case TNFCTL_ERR_USR3:
case TNFCTL_ERR_USR4:
case TNFCTL_ERR_USR5:
default:
return (dgettext(TEXT_DOMAIN,
"Unknown libtnfctl.so error code"));
}
}
/*
* prb_map_to_errocde() - this routine returns maps an internal error code
* to a tnfctl_errcode_t
*/
{
if (prbstat >= PRB_STATUS_MINERRNO &&
prbstat <= PRB_STATUS_MAXERRNO) {
} else {
if (prbstat == PRB_STATUS_OK)
else if (prbstat == PRB_STATUS_ALLOCFAIL)
}
return (err);
}
/*
* tnfctl_status_map() - this routine converts an errno value into a
* tnfctl_errcode_t
*/
{
return (err);
}