> The Austin group debated making the next version of POSIX required to > always return a non-NULL result for strerror (although for out-of-range > errors, there was no guarantee that the string had to be unique, as in > printing what the out-of-range value was). However, I think that proposal > has stalled, so the Interix behavior of returning NULL for strerror(-1) is > not yet non-POSIX compliant.
I take that back. POSIX 2001 and C99 TC3 both state this: | Typically, the values for errnum come from errno, but strerror() shall | map any value of type int to a message. See also: http://www.opengroup.org/austin/interps/uploads/40/9947/AI-072.txt where the next draft of POSIX is even more explicit that: | Upon completion, whether successful or not, strerror( ) shall return | a pointer to the generated message string. > I am very much in favor of a gnulib > implementation of strerror that works harder to provide non-NULL results. Sounds like we need to update the gnulib replacement for strerror to accomodate broken platforms like Interix. -- Eric Blake -- View this message in context: http://www.nabble.com/Re%3A-error.c%3A-%22Unknown-system-error%22-should-report-errno-value-tf4513158.html#a12881056 Sent from the Gnulib mailing list archive at Nabble.com.