Re: [HACKERS] 7.4.2 Build broken on (Sparc) Solaris 7 and 8

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Cc: jseymour(at)LinxNet(dot)com
Subject: Re: [HACKERS] 7.4.2 Build broken on (Sparc) Solaris 7 and 8
Date: 2004-03-20 15:44:32
Message-ID: 200403201544.i2KFiWe00983@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> > "make' results in:
> >
> > gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
> > -Wmissing-declarations -fPIC -I. -I../../../src/include
> > -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/etc"' -c -o thread.o
> > thread.c
> > thread.c: In function `pqGetpwuid':
> > thread.c:116: error: too many arguments to function `*getpwuid_r*'
> > thread.c: In function `pqGethostbyname':
> > thread.c:189: error: `resbuf' undeclared (first use in this function)
> > thread.c:189: error: (Each undeclared identifier is reported only once
> > thread.c:189: error: for each function it appears in.)
> >
> > Diff'ing thread.c between 7.4.1 and 7.4.2, it *looks* like, at first
> > blush, nothing changed that should affect the relevant code.
> >
> > Anybody got any idea what's broken?
>
> Unfortunately, I know exactly what is broken. First, pre7.4.2 didn't
> use thread.c properly. Now that it does, you are breaking on this
> issue:
>
> /*
> * Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
> * getpwuid_r(uid, resultbuf, buffer, buflen)
> * Do we need to support it? bjm 2003-08-14
> */
> /* POSIX version */
> getpwuid_r(uid, resultbuf, buffer, buflen, result);
>
> Notice the comment. Do we have to support getpwuid_r that returns
> passwd *, and doesn't take a fourth argument? Yea, for Solaris 7 & 8,
> we now we now do. I think you can get yours working by just changing
> the call to:
>
> result = getpwuid_r(uid, resultbuf, buffer, buflen);
>
> I will have to add configure tests for this and it will work properly
> for you in 7.4.3.

OK, patch attached and applied. It adds configure tests for the 5-arg
version of getpwuid_r() and properly falls back to the Posix draft
version you have on Solaris. Seems Solaris 9 also still has the draft
version.

This is backpatched to 7.4.X so it will be in the next release. I have
attached the CVS head and 7.4.X versions of the patch for your testing.
You will need to re-run configure once you apply the patch.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 5.8 KB
unknown_filename text/plain 5.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-03-20 15:53:18 Re: listening addresses
Previous Message Joe Conway 2004-03-20 05:41:49 Re: looking for an 'array_index' function?

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2004-03-20 15:53:18 Re: listening addresses
Previous Message Larry Rosenman 2004-03-19 19:54:07 Re: [HACKERS] UnixWare/CVS Tip/initdb.c needs to use