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

Jeremy Huddleston jeremyhu at apple.com
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
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 08 16:30:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy Huddleston
>Release:        trunk
>Organization:
Apple Inc
>Environment:
NA
>Description:
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.


>How-To-Repeat:

>Fix:
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 @@
 .Er EINVAL
 as a warning.
 Error numbers recognized by this implementation fall in
-the range 0 <
+the range 0 <=
 .Fa errnum
 <
 .Fa sys_nerr .


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-standards mailing list