Joerg Schilling schilling at
Wed Feb 6 12:31:12 PST 2002

>From: "Wichmann, Mats D" <mats.d.wichmann at>

>> >> Call strerror() and check if it returns a NULL pointer.
>> >sterror doesn't return NULL; it returns "Unknown error x" if 
>> >you call it with an out-of-range x. 
>> Looks like you found a broken strerror() implementation.

>Eh?  Even the SUS wording indicates that there's no return
>value reserved to indicate an error.  It does describe a way 
>to test for failure, however, by mucking with errno.

You  are right, it is not very specifc.

>The behavior on a standard Linux system (glibc 2.2) is as
>described above on invalid errnos:  "Unknown error x".

Which is illegal according to SUSv3.

SUSv3 requires that strerror() is thread-safe, so it cannot
return a modified string.

A conforming implementation may either behave like on SYSv
since 1988and return NULL or return a constant string.


 EMail:joerg at (home) Jörg Schilling D-13353 Berlin
       js at		(uni)  If you don't have iso-8859-1
       schilling at		(work) chars I am J"org Schilling

More information about the lsb-discuss mailing list