This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strerror_r not according to standard ?


On 05/24/2010 10:04 AM, Vinu Rajashekhar wrote:
> I have a doubt regarding the newlib implementation of strerror_r.

strerror_r is a can of worms, thanks to the conflict between GNU and
POSIX definitions.

> 
> The function doesn't set ERANGE if the buflen given is insufficient
> to store the whole description of the errno. Similarly, it doesn't set
> EINVAL if errno is not a  valid error number.

Patches to fix that behavior to be more like glibc would be welcome.

> 
> Another thing is that it, in the linux manpages it says that strerror_r (the GNU
> extension) always returns a null-terminated string, which is not the case
> for the newlib strerror_r.

Again, patches welcome.  But patches to change things to match the POSIX
signature would have to be conditionalized, because some newlib clients
(like cygwin) still want to keep the glibc signature.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]