summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/strerror.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/string/strerror.3')
-rw-r--r--lib/libc/string/strerror.315
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/libc/string/strerror.3 b/lib/libc/string/strerror.3
index 037b138..2ed92d6 100644
--- a/lib/libc/string/strerror.3
+++ b/lib/libc/string/strerror.3
@@ -110,8 +110,15 @@ returns an error message string containing
.Dq Li "Unknown error:\ "
followed by the error number in decimal, while
.Fn strerror_r
-returns
+leaves
+.Fa strerrbuf
+unchanged and returns
.Er EINVAL .
+Error numbers recognized by this implementation fall in
+the range 0 <=
+.Fa errnum
+<
+.Fa sys_nerr .
.Pp
If insufficient storage is provided in
.Fa strerrbuf
@@ -121,9 +128,11 @@ to contain the error string,
.Fn strerror_r
returns
.Er ERANGE
-and the contents of
+and
.Fa strerrbuf
-are indeterminate.
+will contain an error message that has been truncated and nul
+terminated to fit the length specified by
+.Fa buflen .
.Pp
The message strings can be accessed directly using the external
array
OpenPOWER on IntegriCloud