>From: "Wichmann, Mats D" <email@example.com>
>> >> 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:firstname.lastname@example.org (home) Jörg Schilling D-13353 Berlin
email@example.com (uni) If you don't have iso-8859-1
firstname.lastname@example.org (work) chars I am J"org Schilling
URL: http://www.fokus.gmd.de/usr/schilling ftp://ftp.fokus.gmd.de/pub/unix