Re: threads/UnixWare

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: threads/UnixWare
Date: 2003-08-08 06:10:25
Message-ID: 200308080610.h786APD12978@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Actually, your getpwuid_r is the old, pre-POSIX format. The attached
email has the configure tests. I was hoping we wouldn't need them, but
it seems we may.

---------------------------------------------------------------------------

Larry Rosenman wrote:
> In src/port, we have in threads.c:
>
> /*
> * Wrapper around getpwuid() or getpwuid_r() to mimic POSIX getpwuid_r()
> * behaviour, if it is not available.
> */
> int
> pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
> size_t buflen, struct passwd ** result)
> {
> #if defined(USE_THREADS) && defined(HAVE_GETPWUID_R)
>
> /*
> * broken (well early POSIX draft) getpwuid_r() which returns
> 'struct
> * passwd *'
> */
> *result = getpwuid_r(uid, resultbuf, buffer, buflen);
> #else
> /* no getpwuid_r() available, just use getpwuid() */
> *result = getpwuid(uid);
> #endif
> return (*result == NULL) ? -1 : 0;
> }
>
>
> Which BREAKS if you have the correct getpwuid_r() like UnixWare does.
>
> Can someone help me with the configure checks/macros I need?
> $ grep getpwuid_r /usr/include/pwd.h
> int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
> $
>
>
>
>
> --
> Larry Rosenman http://www.lerctr.org/~ler
> Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
> US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>

--
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 0 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Larry Rosenman 2003-08-08 06:23:47 Re: threads/UnixWare
Previous Message Joe Conway 2003-08-08 05:29:07 Re: [HACKERS] IS OF