t_strerror.c (7c478bd9) t_strerror.c (61961e0f)
1/*
2 * CDDL HEADER START
3 *
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
7 * with the License.
8 *

--- 5 unchanged lines hidden (view full) ---

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]
19 *
20 * CDDL HEADER END
21 */
1/*
2 * CDDL HEADER START
3 *
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
7 * with the License.
8 *

--- 5 unchanged lines hidden (view full) ---

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]
19 *
20 * CDDL HEADER END
21 */
22
22/*
23/*
23 * Copyright 1993-2003 Sun Microsystems, Inc. All rights reserved.
24 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
25 * Use is subject to license terms.
26 */
27
27
28#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
29
28#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
29
30
31/*LINTLIBRARY*/
32#include "mt.h"
33#include <unistd.h>
34#include <stdio.h>
35#include <stddef.h>
36#include <libintl.h>
37#include <stropts.h>
38#include <xti.h>
39#include "tx.h"

--- 44 unchanged lines hidden (view full) ---

84char *
85_tx_strerror(int errnum, int api_semantics)
86{
87 static char buf[BUFSIZ];
88
89 if (_T_IS_XTI(api_semantics)) {
90 if (errnum <= _xti_nerr && errnum >= 0)
91 return (dgettext(__nsl_dom, _xti_errlist[errnum]));
30#include "mt.h"
31#include <unistd.h>
32#include <stdio.h>
33#include <stddef.h>
34#include <libintl.h>
35#include <stropts.h>
36#include <xti.h>
37#include "tx.h"

--- 44 unchanged lines hidden (view full) ---

82char *
83_tx_strerror(int errnum, int api_semantics)
84{
85 static char buf[BUFSIZ];
86
87 if (_T_IS_XTI(api_semantics)) {
88 if (errnum <= _xti_nerr && errnum >= 0)
89 return (dgettext(__nsl_dom, _xti_errlist[errnum]));
92 else {
93 snprintf(buf, sizeof (buf), "%d: %s", errnum,
94 dgettext(__nsl_dom, "error unknown"));
95 return (buf);
96 }
97 } else { /* TX_TLI_API */
98 /*
99 * This code for TLI only. It uses "t_nerr" and "t_errlist"
100 * which are exposed interfaces in the t_error() man page.
101 * XTI uses different array to avoid binary compatibility
102 * issues in using the exposed array. [ XTI t_error() does
103 * not mention the error message list array ]
104 *
105 * For the moment we simply index into the t_errlist[] array.
106 * When the array fills (we cannot allow it to expand in size
107 * or binary compatibility will be broken), this code will need
108 * modification. See the comment in _errlst.c.
109 */
110 if (errnum < t_nerr && errnum >= 0)
111 return (dgettext(__nsl_dom, t_errlist[errnum]));
112 else {
113 snprintf(buf, sizeof (buf), "%d: %s", errnum,
114 dgettext(__nsl_dom, "error unknown"));
115 return (buf);
116 }
90 (void) snprintf(buf, sizeof (buf), "%d: %s", errnum,
91 dgettext(__nsl_dom, "error unknown"));
92 return (buf);
117 }
93 }
94
95 /* TX_TLI_API */
96 /*
97 * This code for TLI only. It uses "t_nerr" and "t_errlist"
98 * which are exposed interfaces in the t_error() man page.
99 * XTI uses different array to avoid binary compatibility
100 * issues in using the exposed array. [ XTI t_error() does
101 * not mention the error message list array ]
102 *
103 * For the moment we simply index into the t_errlist[] array.
104 * When the array fills (we cannot allow it to expand in size
105 * or binary compatibility will be broken), this code will need
106 * modification. See the comment in _errlst.c.
107 */
108 if (errnum < t_nerr && errnum >= 0)
109 return (dgettext(__nsl_dom, t_errlist[errnum]));
110 (void) snprintf(buf, sizeof (buf), "%d: %s", errnum,
111 dgettext(__nsl_dom, "error unknown"));
112 return (buf);
118}
113}