2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright 1989 AT&T
44 .\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved.
45 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
46 .\" Copyright 2015, Joyent, Inc.
47 .\" Copyright 2024 Oxide Computer Company
58 .Nd get error message string
89 function maps the error number in
91 to an error message string, and returns a pointer to that string.
92 It uses the same set of error messages as
94 The returned string should not be overwritten.
95 The string will be translated based on the current locale.
99 function maps the error number in
101 to an error message string and returns the string in the buffer pointed to by
108 function maps the error number in
110 to an error message string in the locale indicated by
112 The returned string should not be overwritten.
117 pointer, then the locale of the calling thread's current locale will be used
125 functions, return localized strings in the event of an unknown error, one must
129 Callers should first set
133 before the call to either function and then check the value of
138 is non-zero then an error has occurred.
142 function behaves the same as
144 but will always return the error message string in the C locale and will
145 not provide a translate message.
148 unknown error messages will return a
155 is still advised, as with
162 into the string name of the error constant.
167 When passed the value of 0, there is no traditional error string.
168 To match originating implementations, the string
170 is returned in that case.
172 Upon successful completion,
176 return a pointer to the generated message string.
179 and returns a pointer to an error message string.
180 They return the localized string
184 is not a valid error number.
186 Upon successful completion,
192 and returns the value of
194 to indicate the error.
195 It returns the localized string
197 in the buffer pointed to by
201 is not a valid error number.
203 Upon successful completion, the
205 function returns the C locale's generated message string.
213 this occurs when a string's translation is not known.
215 Upon successful completion, the
217 function returns the C language constant name of the error.
224 These functions may fail if:
229 is not a valid error number.
234 function may fail if:
239 argument specifies insufficient storage to contain the generated message string.
242 Messages returned from these functions
249 are in the native language specified by the
256 .Sh INTERFACE STABILITY