diff options
Diffstat (limited to 'src/lib/libc/string/strerror.3')
| -rw-r--r-- | src/lib/libc/string/strerror.3 | 154 |
1 files changed, 0 insertions, 154 deletions
diff --git a/src/lib/libc/string/strerror.3 b/src/lib/libc/string/strerror.3 deleted file mode 100644 index 6c5b890fa4..0000000000 --- a/src/lib/libc/string/strerror.3 +++ /dev/null | |||
| @@ -1,154 +0,0 @@ | |||
| 1 | .\" $OpenBSD: strerror.3,v 1.16 2019/05/16 13:35:16 schwarze Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 1980, 1991 Regents of the University of California. | ||
| 4 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | ||
| 5 | .\" All rights reserved. | ||
| 6 | .\" | ||
| 7 | .\" This code is derived from software contributed to Berkeley by | ||
| 8 | .\" the American National Standards Committee X3, on Information | ||
| 9 | .\" Processing Systems. | ||
| 10 | .\" | ||
| 11 | .\" Redistribution and use in source and binary forms, with or without | ||
| 12 | .\" modification, are permitted provided that the following conditions | ||
| 13 | .\" are met: | ||
| 14 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 15 | .\" notice, this list of conditions and the following disclaimer. | ||
| 16 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 17 | .\" notice, this list of conditions and the following disclaimer in the | ||
| 18 | .\" documentation and/or other materials provided with the distribution. | ||
| 19 | .\" 3. Neither the name of the University nor the names of its contributors | ||
| 20 | .\" may be used to endorse or promote products derived from this software | ||
| 21 | .\" without specific prior written permission. | ||
| 22 | .\" | ||
| 23 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 24 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 25 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 26 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 27 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 28 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 29 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 30 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 31 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 32 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 33 | .\" SUCH DAMAGE. | ||
| 34 | .\" | ||
| 35 | .Dd $Mdocdate: May 16 2019 $ | ||
| 36 | .Dt STRERROR 3 | ||
| 37 | .Os | ||
| 38 | .Sh NAME | ||
| 39 | .Nm strerror , | ||
| 40 | .Nm strerror_l , | ||
| 41 | .Nm strerror_r | ||
| 42 | .Nd get error message string | ||
| 43 | .Sh SYNOPSIS | ||
| 44 | .In string.h | ||
| 45 | .Ft char * | ||
| 46 | .Fn strerror "int errnum" | ||
| 47 | .Ft char * | ||
| 48 | .Fn strerror_l "int errnum" "locale_t locale" | ||
| 49 | .Ft int | ||
| 50 | .Fn strerror_r "int errnum" "char *strerrbuf" "size_t buflen" | ||
| 51 | .Sh DESCRIPTION | ||
| 52 | These functions map the error number | ||
| 53 | .Fa errnum | ||
| 54 | to an error message string. | ||
| 55 | .Pp | ||
| 56 | .Fn strerror | ||
| 57 | and | ||
| 58 | .Fn strerror_l | ||
| 59 | return a string containing a maximum of | ||
| 60 | .Dv NL_TEXTMAX | ||
| 61 | characters, including the trailing NUL. | ||
| 62 | This string is not to be modified by the calling program. | ||
| 63 | The string returned by | ||
| 64 | .Fn strerror | ||
| 65 | may be overwritten by subsequent calls to | ||
| 66 | .Fn strerror | ||
| 67 | in any thread. | ||
| 68 | The string returned by | ||
| 69 | .Fn strerror_l | ||
| 70 | may be overwritten by subsequent calls to | ||
| 71 | .Fn strerror_l | ||
| 72 | in the same thread. | ||
| 73 | .Pp | ||
| 74 | .Fn strerror_r | ||
| 75 | is a thread safe version of | ||
| 76 | .Fn strerror | ||
| 77 | that places the error message in the specified buffer | ||
| 78 | .Fa strerrbuf . | ||
| 79 | .Pp | ||
| 80 | On | ||
| 81 | .Ox , | ||
| 82 | the global locale, the thread-specific locale, and the | ||
| 83 | .Fa locale | ||
| 84 | argument are ignored. | ||
| 85 | .Sh RETURN VALUES | ||
| 86 | .Fn strerror | ||
| 87 | and | ||
| 88 | .Fn strerror_l | ||
| 89 | return a pointer to the error message string. | ||
| 90 | If an error occurs, the error code is stored in | ||
| 91 | .Va errno . | ||
| 92 | .Pp | ||
| 93 | .Fn strerror_r | ||
| 94 | returns zero upon successful completion. | ||
| 95 | If an error occurs, the error code is stored in | ||
| 96 | .Va errno | ||
| 97 | and the error code is returned. | ||
| 98 | .Sh ERRORS | ||
| 99 | All these functions may fail if: | ||
| 100 | .Bl -tag -width Er | ||
| 101 | .It Bq Er EINVAL | ||
| 102 | .Fa errnum | ||
| 103 | is not a valid error number. | ||
| 104 | The returned error string will consist of an error message that includes | ||
| 105 | .Fa errnum . | ||
| 106 | .El | ||
| 107 | .Pp | ||
| 108 | .Fn strerror_r | ||
| 109 | may also fail if: | ||
| 110 | .Bl -tag -width Er | ||
| 111 | .It Bq Er ERANGE | ||
| 112 | The error message is larger than | ||
| 113 | .Fa buflen | ||
| 114 | characters. | ||
| 115 | The message will be truncated to fit. | ||
| 116 | .El | ||
| 117 | .Sh SEE ALSO | ||
| 118 | .Xr intro 2 , | ||
| 119 | .Xr newlocale 3 , | ||
| 120 | .Xr perror 3 , | ||
| 121 | .Xr setlocale 3 | ||
| 122 | .Sh STANDARDS | ||
| 123 | The | ||
| 124 | .Fn strerror | ||
| 125 | function conforms to | ||
| 126 | .St -isoC-99 . | ||
| 127 | The | ||
| 128 | .Fn strerror_l | ||
| 129 | and | ||
| 130 | .Fn strerror_r | ||
| 131 | functions conform to | ||
| 132 | .St -p1003.1-2008 . | ||
| 133 | .Sh HISTORY | ||
| 134 | The | ||
| 135 | .Fn strerror | ||
| 136 | function has been available since | ||
| 137 | .Bx 4.3 Reno , | ||
| 138 | .Fn strerror_r | ||
| 139 | since | ||
| 140 | .Ox 3.3 , | ||
| 141 | and | ||
| 142 | .Fn strerror_l | ||
| 143 | since | ||
| 144 | .Ox 6.2 . | ||
| 145 | .Sh CAVEATS | ||
| 146 | On systems other than | ||
| 147 | .Ox , | ||
| 148 | the | ||
| 149 | .Dv LC_MESSAGES | ||
| 150 | .Xr locale 1 | ||
| 151 | category can cause different strings to be returned instead of the | ||
| 152 | normal error messages; see CAVEATS in | ||
| 153 | .Xr setlocale 3 | ||
| 154 | for details. | ||
