Re: RFS: libexplain
On Wednesday 24 December 2008 17:40:42 Boyd Stephen Smith Jr. wrote:
> On Wednesday 2008 December 24 08:19:27 George Danchev wrote:
> > strerror_r(3) (which is
> > GNU-specific, ok)
> SUSv3 introduced strerror_r as well, as part of the "Thread Safe Functions"
> option. The two definitions are incompatible, but both available in glibc!
>  I favor the SUSv3 interface/semantics, but I understand that the GNU
> version predates it by some time.
>  I don't completely understand the technical details, but if your code
> indicates _XOPEN_SOURCE >= 600 and not _GNU_SOURCE you can get the SUSv3
> version. Otherwise you get the GNU version.
Sure, that is explained in string.h  (but not in my copy of glibc doc
reference, unless I'm blind ;-), but the reentrant version of strerror (with
its two flavors) is not the most interesting part here, is it ?
 /* Reentrant version of `strerror'.
There are 2 flavors of `strerror_r', GNU which returns the string
and may or may not use the supplied temporary buffer and POSIX one
which fills the string into the buffer.
To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L
without -D_GNU_SOURCE is needed, otherwise the GNU version is
pub 4096R/0E4BD0AB 2003-03-18 <people.fccf.net/danchev/key pgp.mit.edu>