summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/strerror.3
diff options
context:
space:
mode:
authorwes <wes@FreeBSD.org>2001-12-06 04:53:31 +0000
committerwes <wes@FreeBSD.org>2001-12-06 04:53:31 +0000
commit9a811aeadbcae64af62451c202a0bb317945a9dc (patch)
tree5e497a3ec40cddc305b92cc007654a2bd8169cbb /lib/libc/string/strerror.3
parent9beed4b8190f3bada01b6b0ea725fbe8d6eb14bd (diff)
downloadFreeBSD-src-9a811aeadbcae64af62451c202a0bb317945a9dc.zip
FreeBSD-src-9a811aeadbcae64af62451c202a0bb317945a9dc.tar.gz
New, improved, more Posix-compliant strerror_r implementation,
complete with documentation. Reviewed by: mike@ gad@ MFC after: 1 week
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