summaryrefslogtreecommitdiffstats
path: root/newlib/libc/string/strerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/string/strerror.c')
-rw-r--r--newlib/libc/string/strerror.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/newlib/libc/string/strerror.c b/newlib/libc/string/strerror.c
index 043763141..61e40ab7a 100644
--- a/newlib/libc/string/strerror.c
+++ b/newlib/libc/string/strerror.c
@@ -301,6 +301,17 @@ declares that subsequent calls to <<strerror>> may overwrite the
result string; therefore portable code cannot depend on the reentrancy
of this subroutine.
+Although this implementation of <<strerror>> guarantees a non-null
+result with a NUL-terminator, some implementations return <<NULL>>
+on failure. Although POSIX allows <<strerror>> to set <<errno>>
+to EINVAL on failure, this implementation does not do so (unless
+you provide <<_user_strerror>>).
+
+POSIX recommends that unknown <[errnum]> result in a message
+including that value, however it is not a requirement and this
+implementation does not provide that information (unless you
+provide <<_user_strerror>>).
+
This implementation of <<strerror>> provides for user-defined
extensibility. <<errno.h>> defines <[__ELASTERROR]>, which can be
used as a base for user-defined error values. If the user supplies a
@@ -313,6 +324,9 @@ character pointer. If <[errnum]> is unknown to <<_user_strerror>>,
<<_user_strerror>> returns <[NULL]>. The default <<_user_strerror>>
returns <[NULL]> for all input values.
+Note that <<_user_sterror>> must be thread-safe and not alter <<errno>>
+if <<strerror_r>> is to comply with POSIX.
+
<<strerror>> requires no supporting OS subroutines.
QUICKREF