Skip site navigation (1) Skip section navigation (2)

Re: Improved fix for sys_nerr

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pete Forman <gsez020(at)kryten(dot)bedford(dot)waii(dot)com>, pgsql-patches(at)postgresql(dot)org, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Improved fix for sys_nerr
Date: 2000-10-27 19:00:37
Message-ID: Pine.LNX.4.21.0010272057530.838-100000@peter.localdomain (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Tom Lane writes:

> I recommend adding a configure test to see whether sys_nerr exists,
> and trusting strerror() to be bulletproof only where it does not.
> As you say, there could be holes in the error number assignment,
> so an additional test for NULL result from strerror() seems wise.

Definitely a good plan.  If someone wants to be really dilligent he could
write up a "pgstrerror", which

1. does the str_nerr check if it exists
2. runs strerror(errno)
3. checks for NULL or EINVAL
4. returns something useful

You put that into src/utils and link it into every program or library that
uses strerror.

Any reasonable subset of this solution would be fine as well. :)

Peter Eisentraut      peter_e(at)gmx(dot)net

In response to

pgsql-patches by date

Next:From: Bruce MomjianDate: 2000-10-28 18:26:39
Subject: Re: Beos updates
Previous:From: Pete FormanDate: 2000-10-27 11:19:05
Subject: Re: Improved fix for sys_nerr

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group