Pete, can you handle coversion of fprintf(stderr) to elog at the same
time? It would be nice, but it can only be done in places where elog is
safe.
Content-Description: message body text
> I'm preparing a patch for backend/utils/error to make the printing of
> error messages more robust. It would be very helpful if people on
> different systems would compile and run the following test program to
> check the behaviour of strerror().
>
> The PostgreSQL code is called only in exceptional circumstances, so
> regular testing of my changes is not possible.
>
> According to the standards UNIX95 (aka XPG4v2) and later, strerror()
> should set errno to EINVAL if its argument is out of range. Most
> compliant systems seem to return a default string with a number
> printed in it and so never set errno.
>
> sys_nerr was last in XPG2 but has now been dropped. I'm hoping to
> remove it from the PostgreSQL code.
>
Content-Description: Test behaviour of strerror()
[ Attachment, skipping... ]
Content-Description: message body and .signature
>
> My results so far follow. I've listed them by OS though there is also
> a dependency on libc.
>
> AIX 4.3: errno = 0 after strerror(-1) returned "Error -1 occurred."
> Cygwin B20: errno = 0 after strerror(-1) returned "error -1"
> IRIX 6.5: errno = 0 after strerror(-1) returned NULL
> Redhat 6.2: errno = 0 after strerror(-1) returned "Unknown error 4294967295"
> Solaris 2.6: errno = 0 after strerror(-1) returned NULL
> Solaris 7: errno = 0 after strerror(-1) returned NULL
>
>
> What I'd like to know is whether any version of strerror() returns a
> non-NULL pointer that does not contain a print of the number.
> --
> Pete Forman -./\.- Disclaimer: This post is originated
> Western Geophysical -./\.- by myself and does not represent
> pete.forman@westgeo.com -./\.- the opinion of Baker Hughes or
> http://www.crosswinds.net/~petef -./\.- its divisions.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026