Re: Threading fix for AIX

From: "Zeugswetter Andreas DAZ SD" <ZeugswetterA(at)spardat(dot)at>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Andrew Sullivan" <ajs(at)crankycanuck(dot)ca>, "PostgreSQL-patches" <pgsql-patches(at)postgresql(dot)org>, "Brad Nicholson" <bnichols(at)ca(dot)afilias(dot)info>
Subject: Re: Threading fix for AIX
Date: 2004-12-16 16:18:25
Message-ID: 46C15C39FEB2C44BA555E356FBCD6FA40184D278@m0114.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Bruce Momjian wrote:
> > Zeugswetter Andreas DAZ SD wrote:
> > >
> > > >> 1. the snprintf long long int check that uses int64 as variable name which is
> > > >> a typedef in sys/inttypes.h
> > > >
> > > > I changed it to ac_int64. Does that help?
> > >
> > > One more is needed in c-library.m4.
> >
> > OK, done.
> >
> > > >> 2. whether strerror_r returns int check fails with a redefine of named function
> > > >> from string.h
> > > >
> > > > I see. Our test is:
> > > > int strerror_r(int, char *, size_t);
> > > > but AIX is:
> > > > int strerror_r(int, char *, int);
> > > > OK, I added an #ifndef _AIX to use 'int' for the 3rd arg for AIX.
> > >
> > > The wrong define is only on older AIX versions :-(
> > > And the patch produces wrong code asis (missing # and #endif).
> > > Since AIX always has the int returning function, how about no test on AIX:
> > > #ifndef_AIX
> > > int strerror_r(int, char *, size_t);
> > > #endif
>
> OK, improved patch. You mentioned only older versions of AIX have an
> 'int' for the 3rd strerror_r argument so we will just test for the
> return value on AIX and not the args:
>
> int strerror();
>
> If there are other platforms that have this we could use it on all
> platforms but at this point we will do just AIX.

That is the perfect patch. Thank you Bruce. All tests pass on AIX 4.3.2 and 5.2.0
with --enable-thread-safety and this last patch.

I am quite sure xlc_r is not needed to compile a thread safe libpq. Only those
writing threaded clients will want to use it for compiling and linking their
executables if they use usually not thread safe libc functions (like gethostbyname).

Andreas

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-12-16 17:46:46 Re: [WIP] The shared dependency patch
Previous Message Peter Eisentraut 2004-12-16 11:31:23 Re: sl translations of .po files