Re: Re: Cygwin PostgreSQL postmaster abort problem - Mailing list pgsql-ports

From Peter Eisentraut
Subject Re: Re: Cygwin PostgreSQL postmaster abort problem
Date
Msg-id Pine.LNX.4.30.0101021749560.758-100000@peter.localdomain
Whole thread Raw
In response to Re: Re: Cygwin PostgreSQL postmaster abort problem  (Jason Tishler <Jason.Tishler@dothill.com>)
Responses Re: Re: Cygwin PostgreSQL postmaster abort problem
Re: Re: Cygwin PostgreSQL postmaster abort problem
List pgsql-ports
Jason Tishler writes:

> > >         * src/backend/utils/error/elog.c: Add conditional compilation to deal
> > >         with sys_nerr/_sys_nerr inconsistencies.
> > >         * src/backend/utils/error/exc.c: Ditto.
> >
> > This is the wrong place.
>
> Sorry, but I'm not that intimate with the PostgreSQL code so when I saw
> the following in elog.c and exc.c:
>
>     #ifdef __CYGWIN__
>     # define sys_nerr _sys_nerr
>     #endif
>     extern int  sys_nerr;

I guess there were some people before you that weren't that intimate with
the code either.  ;-)

> I thought that it was reasonable to change it to:
>
>     #ifdef __CYGWIN__
>     # define sys_nerr _sys_nerr
>     #else
>     extern int  sys_nerr;
>     #endif

I think if Cygwin's strerror() copes with out-of-range errno's, then we
can just leave of the whole business completely.

> > You should look into src/include/port/win.h to fix this.
>
> How is this file suppose to be used?  When I do a find, I get the
> following:

> Hence, no source file is currently including it.

src/include/port/anything.h is symlinked to src/include/port.h when you
run configure.  port.h is included by config.h, which is included by c.h,
which is included by postgres.h, which is included by just about
everything.  (Note to self:  Are that many levels really necessary?)

> > >         * src/utils/dllinit.c: Update to be consistent with Cygwin Net Release.
> >
> > Will this break old releases of Cygwin?
>
> I don't know since I don't have b20.1 or older lying around anymore --
> but my guess is yes.  However, without this change PostgreSQL does *not*
> build OOTB with the current Cygwin release.

Well, it's not like I really care, as I obviously don't use Cygwin, but
dropping support for old OS version just because new ones came out is not
that cool, unless you can make a really good argument that no one in their
right mind would use that old version anymore.

> Note that this file is no longer needed with current Cygwin releases.
> Cygwin provides its own "DllMain" now.  May be a compromise would be to
> have make check the Cygwin version and eliminate dllinit.c from the
> build if it is not necessary.  I am willing to submit such a patch if it
> was deemed reasonable.

Sounds great to me.  Maybe the CYGWIN_VERSION_API_MAJOR/MINOR symbols
could be used to #ifdef out the entire dllinit.c if not needed?  (A more
"correct" approach would probably be to check for the existance of
DllMain, but I'm not sure if you/we are up to that at this point.)

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


pgsql-ports by date:

Previous
From: Horák Daniel
Date:
Subject: RE: Porting to Win2k: ./configure failed
Next
From: Jason Tishler
Date:
Subject: Cygwin PostgreSQL DLL PATH (regression test) Problem