4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1994, by Sun Microsytems, Inc.
26 #pragma ident "%Z%%M% %I% %E% SMI"
29 * Interfaces to print error codes and to map an errno to an error code.
35 #include "tnfctl_int.h"
39 #if !defined(TEXT_DOMAIN)
40 #define TEXT_DOMAIN "SYS_TEST"
44 * prb_status_str() - this routine returns a pointer to a static string
45 * describing the error argument.
48 prb_status_str(prb_status_t prbstat
)
50 /* if this is in the errno range, use the errno string */
51 if (prbstat
>= PRB_STATUS_MINERRNO
&&
52 prbstat
<= PRB_STATUS_MAXERRNO
) {
53 return (strerror(prbstat
));
57 return (dgettext(TEXT_DOMAIN
, "success"));
58 case PRB_STATUS_ALLOCFAIL
:
59 return (dgettext(TEXT_DOMAIN
,
60 "memory allocation failed"));
61 case PRB_STATUS_BADARG
:
62 return (dgettext(TEXT_DOMAIN
, "bad input argument"));
63 case PRB_STATUS_BADSYNC
:
64 return (dgettext(TEXT_DOMAIN
,
65 "couldn't sync with rtld"));
66 case PRB_STATUS_BADLMAPSTATE
:
67 return (dgettext(TEXT_DOMAIN
, "inconsistent link map"));
69 return (dgettext(TEXT_DOMAIN
,
70 "Unknown libtnfctl.so prb layer error code"));
76 * prb_status_map() - this routine converts an errno value into a
80 prb_status_map(int val
)