standards/151316: lib/libc/string/strerror.c r1.9 breaks POSIX

Jeremy Huddleston jeremyhu at
Fri Oct 8 16:30:07 UTC 2010

>Number:         151316
>Category:       standards
>Synopsis:       lib/libc/string/strerror.c r1.9 breaks POSIX
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-standards
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 08 16:30:06 UTC 2010
>Originator:     Jeremy Huddleston
>Release:        trunk
Apple Inc
r1.9 of strerror.c did the following (from the changeslog)

strerror()'s semantics have changed slightly such that an argument of
0 is now considered invalid and errno is set to EINVAL.

This introduces a regression in SUS conformance.


In strerror.c's strerror_r
-	if (errnum < 1 || errnum >= sys_nerr) {
+	if (errnum < 0 || errnum >= sys_nerr) {

And here's a man page change:

@@ -110,7 +118,7 @@
 as a warning.
 Error numbers recognized by this implementation fall in
-the range 0 <
+the range 0 <=
 .Fa errnum
 .Fa sys_nerr .


More information about the freebsd-standards mailing list