> strerror(3) claims that strerror_r returns an integer that is zero for > success and non-zero for failure; in fact, it returns a char * and the > code > appears to say that there is no way to distinguish success and failure; > if the buffer is too small the string is just truncated.
Daniel, I am _not_ looking at the Debian sources, but at recent glibc vanilla sources. According to those (sysdeps/generic/xpg-strerror.c), the (vanilla) manual pages that I maintain are correct, *if* one defines _XOPEN_SOURCE as 600, as the manual page specifies: #define _XOPEN_SOURCE 600 #include <string.h> int strerror_r(int errnum, char *buf, size_t n); The (vanilla) manual page also has the following text uner CONFORMING TO: An incompatible function, with prototype char *strerror_r(int errnum, char *buf, size_t n); is a GNU extension used by glibc (since 2.0), and must be regarded as obsolete in view of SUSv3. The GNU version may, but need not, use the user-supplied buffer. If it does, the result may be truncated in case the supplied buffer is too small. The result is always NUL-terminated. Does the Debian page not have all of this information? Cheers, Michael -- Michael Kerrisk maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 Want to help with man page maintenance? Grab the latest tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/ and grep the source files for 'FIXME'. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]