Re: Unixware Patch (Was: Re: Beta2 Tag'd and Bundled ...)

From: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unixware Patch (Was: Re: Beta2 Tag'd and Bundled ...)
Date: 2003-08-30 04:09:54
Message-ID: 20030830010748.E13231@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 29 Aug 2003, Larry Rosenman wrote:

>
>
> --On Saturday, August 30, 2003 00:57:45 -0300 "Marc G. Fournier"
> <scrappy(at)hub(dot)org> wrote:
>
> >
> >
> > On Fri, 29 Aug 2003, Larry Rosenman wrote:
> >
> >> Index: src/port/thread.c
> >> ===================================================================
> >> RCS file: /projects/cvsroot/pgsql-server/src/port/thread.c,v
> >> retrieving revision 1.4
> >> diff -u -r1.4 thread.c
> >> --- src/port/thread.c 16 Aug 2003 15:35:51 -0000 1.4
> >> +++ src/port/thread.c 23 Aug 2003 04:29:15 -0000
> >> @@ -68,7 +68,7 @@
> >> pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
> >> size_t buflen, struct passwd **result)
> >> {
> >> -#if defined(USE_THREADS) && defined(NEED_REENTRANT_FUNC_NAMES)
> >> +#if defined(USE_THREADS) && (defined(NEED_REENTRANT_FUNC_NAMES) ||
> >> defined(HAVE_GETPWUID_R))
> >> /*
> >> * Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
> >> * getpwuid_r(uid, resultbuf, buffer, buflen)
> >> Index: src/template/unixware
> >> ===================================================================
> >> RCS file: /projects/cvsroot/pgsql-server/src/template/unixware,v
> >> retrieving revision 1.15
> >> diff -u -r1.15 unixware
> >> --- src/template/unixware 16 Aug 2003 15:35:51 -0000 1.15
> >> +++ src/template/unixware 23 Aug 2003 04:29:15 -0000
> >> @@ -10,5 +10,5 @@
> >> fi
> >>
> >> SUPPORTS_THREADS=yes
> >> -NEED_REENTRANT_FUNC_NAMES=yes
> >> -THREAD_CFLAGS += -D_REENTRANT
> >> +#NEED_REENTRANT_FUNC_NAMES=yes
> >> +THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT -DHAVE_GETPWUID_R"
> >
> > 'K, my first question on this is shouldn't GETPWUID_R be checked for in
> > configure, and not hard coded?
> It's not checked for currently in configure, and doesn't get set. I'm not
> an autoconf
> maven.
> >
> > My second one is what exactly does this fix/accomplish? It looks to me
> > like the result is the same, but I might be missing something obvious?
>
> No, with the change to NEEDS_REENTRANT_FUNC_NAMES, without the ||
> defined(HAVE_GETPWUID_R) magic, we use getpwuid, and not getpwuid_r,
> which would break in a threaded app.

'K, but why the change to NEEDS_REENTRANT_FUNC_NAMES in the first place?

The thing that has me most confused here is that the end result is the
same with or without the patch, from what I can tell ... the right side of
the && will always resolve to TRUE, before or after the patch ... no?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-08-30 04:12:24 Re: SetVariable
Previous Message Larry Rosenman 2003-08-30 04:00:20 Re: Unixware Patch (Was: Re: Beta2 Tag'd and Bundled ...)