5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
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]
24 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
31 * Use is subject to license terms.
34 #pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"
37 #include <scsi/libses.h>
40 \tchar *se_name;\t\t/* error name */
41 \tchar *se_msg;\t\t/* error message */
44 pattern
='^ \(ESES_[A-Z0-9_]*\),*'
51 ( sed -n "s/$pattern/$replace/p" |
sed -n "s/$open/$openrepl/p" |
52 sed -n "s/$close/$closerepl/p" ) ||
exit 1
57 static int _ses_nerrno = sizeof (_ses_errstr) / sizeof (_ses_errstr[0]);\n\
60 ses_strerror(ses_errno_t err)
62 return (err < 0 || err >= _ses_nerrno ? \"unknown error\" :
63 _ses_errstr[err].se_msg);
67 ses_errname(ses_errno_t err)
69 return (err < 0 || err >= _ses_nerrno ? NULL :
70 _ses_errstr[err].se_name);
74 ses_errcode(const char *name)
78 for (err = 0; err < _ses_nerrno; err++) {
79 if (strcmp(name, _ses_errstr[err].se_name) == 0)
83 return (ESES_UNKNOWN);