standards/151316: lib/libc/string/strerror.c r1.9 breaks POSIX
Jeremy Huddleston
jeremyhu at apple.com
Thu Feb 17 18:30:15 UTC 2011
The following reply was made to PR standards/151316; it has been noted by GNATS.
From: Jeremy Huddleston <jeremyhu at apple.com>
To: Jilles Tjoelker <jilles at stack.nl>
Cc: freebsd-gnats-submit at FreeBSD.org
Subject: Re: standards/151316: lib/libc/string/strerror.c r1.9 breaks POSIX
Date: Thu, 17 Feb 2011 10:06:19 -0800
On Oct 9, 2010, at 05:37, Jilles Tjoelker wrote:
>> This introduces a regression in SUS conformance.
>
> Please explain why.
Well first and foremost because it causes the SUS conformance tests to fail:
/tset/PTHR.os/cfuncs/strerror_r/T.strerror_r 1 Failed
Test Description:
For UNIX03 and POSIX01 modes:
If the _POSIX_THREAD_SAFE_FUNCTIONS option is supported:
The strerror_r(errnum, strerrbuf, buflen) function shall map
the error number in errnum to a locale-dependent error message
string and shall return the string in the buffer pointed to by
strerrbuf, with length buflen, and return 0.
Test Information:
strerror_r unexpectedly failed
strerror_r unexpectedly failed
strerror_r unexpectedly failed
strerror_r unexpectedly failed
strerror_r unexpectedly failed
strerror_r unexpectedly failed
strerror_r unexpectedly failed
strerror_r unexpectedly failed
> In any case, this is of little practical effect since few programs check
> the value of errno set by strerror(). If the patch is accepted,
> sys_errlist[0] will probably be changed to "Unknown error: 0" so the
> only difference is errno set by strerror().
You should change it to "No error: 0" or "Success: 0"
More information about the freebsd-standards
mailing list