summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strerror.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/strerror.3')
-rw-r--r--src/lib/libc/string/strerror.331
1 files changed, 27 insertions, 4 deletions
diff --git a/src/lib/libc/string/strerror.3 b/src/lib/libc/string/strerror.3
index c9d8504dbb..05cb7e9d9c 100644
--- a/src/lib/libc/string/strerror.3
+++ b/src/lib/libc/string/strerror.3
@@ -33,12 +33,11 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" from: @(#)strerror.3 6.9 (Berkeley) 6/29/91 36.\" $OpenBSD: strerror.3,v 1.5 2002/11/21 20:45:05 marc Exp $
37.\" $Id: strerror.3,v 1.1.1.1 1995/10/18 08:42:22 deraadt Exp $
38.\" 37.\"
39.Dd June 29, 1991 38.Dd June 29, 1991
40.Dt STRERROR 3 39.Dt STRERROR 3
41.Os BSD 4 40.Os
42.Sh NAME 41.Sh NAME
43.Nm strerror 42.Nm strerror
44.Nd get error message string 43.Nd get error message string
@@ -46,15 +45,35 @@
46.Fd #include <string.h> 45.Fd #include <string.h>
47.Ft char * 46.Ft char *
48.Fn strerror "int errnum" 47.Fn strerror "int errnum"
48.Ft int
49.Fn strerror_r "int errnum" "char *strerrbuf" "size_t buflen"
49.Sh DESCRIPTION 50.Sh DESCRIPTION
50The 51The
51.Fn strerror 52.Fn strerror
52function returns a pointer to the language-dependent error message 53function returns a pointer to the language-dependent error message
53string affiliated with an error number. 54string affiliated with the specified error number
55.Fa errnum .
56The returned string contains a maximum of
57.Dv NL_TEXTMAX
58characters, including the trailing NUL.
54.Pp 59.Pp
55The array pointed to is not to be modified by the program, but may be 60The array pointed to is not to be modified by the program, but may be
56overwritten by subsequent calls to 61overwritten by subsequent calls to
57.Fn strerror . 62.Fn strerror .
63.Pp
64.Fn strerror_r
65is a thread safe version of
66.Fn strerror
67that places the error message in the given buffer
68.Fa strerrbuf .
69If the error message is larger then
70.Fa buflen
71the message will be truncated to fit within buflen and
72.Er ERANGE
73is returned.
74.Fn strerror_r
75returns zero upon successful completion.
76An error number is returned, otherwise.
58.Sh SEE ALSO 77.Sh SEE ALSO
59.Xr intro 2 , 78.Xr intro 2 ,
60.Xr perror 3 , 79.Xr perror 3 ,
@@ -64,3 +83,7 @@ The
64.Fn strerror 83.Fn strerror
65function conforms to 84function conforms to
66.St -ansiC . 85.St -ansiC .
86The
87.Fn strerror_r
88function conforms to
89.St -p1003.1 .