[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: sys_nerr

>From: "Wichmann, Mats D" <mats.d.wichmann@intel.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:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de		(uni)  If you don't have iso-8859-1
       schilling@fokus.gmd.de		(work) chars I am J"org Schilling
 URL:  http://www.fokus.gmd.de/usr/schilling   ftp://ftp.fokus.gmd.de/pub/unix

Reply to: