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.331
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/libc/string/strerror.3 b/lib/libc/string/strerror.3
index ed63b25..037b138 100644
--- a/lib/libc/string/strerror.3
+++ b/lib/libc/string/strerror.3
@@ -81,16 +81,7 @@ function renders the same result into
.Fa strerrbuf
for a maximum of
.Fa buflen
-characters and returns 0 upon success. If insufficient
-storage is provided in
-.Fa strerrbuf
-(as specified in
-.Fa buflen )
-to contain the error string,
-.Er ERANGE
-is returned and the string in
-.Fa strerrbuf
-may not be null-terminated.
+characters and returns 0 upon success.
.Pp
The
.Fn perror
@@ -114,9 +105,25 @@ otherwise, only the error message string is printed.
If
.Fa errnum
is not a recognized error number,
-the error message string will contain
+.Fn strerror
+returns an error message string containing
.Dq Li "Unknown error:\ "
-followed by the error number in decimal.
+followed by the error number in decimal, while
+.Fn strerror_r
+returns
+.Er EINVAL .
+.Pp
+If insufficient storage is provided in
+.Fa strerrbuf
+(as specified in
+.Fa buflen )
+to contain the error string,
+.Fn strerror_r
+returns
+.Er ERANGE
+and the contents of
+.Fa strerrbuf
+are indeterminate.
.Pp
The message strings can be accessed directly using the external
array
OpenPOWER on IntegriCloud