Re: AIX 4.3 getaddrinfo busted

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: AIX 4.3 getaddrinfo busted
Date: 2009-01-23 17:40:17
Message-ID: 497A0101.7060007@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> BTW, what about the comments in ip.c to the effect that some versions of
> AIX fail when getaddrinfo's second argument *is* null?
>

For starters, it indicates that sin_port is not zero'd properly. That
wouldn't matter here since the plan is to manually set the port in this
case, since providing it to getaddrinfo is broken.

Also, this is why I suggested only doing a NULL 2nd arg within the
failure case.

rc = getaddrinfo(hostname, service, ....);

#ifdef _AIX
if(rc == EAI_NODATA && servname && *servname)
if(!(rc = getaddrinfo(hostname, NULL, ....))) /* try again */
/* set sin_port or sin6_port */
#endif

// code continues as is from here down.

Or, set a define in configure indicating aix 4.3 or indicating the 2nd
arg to getaddrinfo must be NULL (the former being much easier). I don't
think we have to resort to configure checks though.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2009-01-23 17:56:15 Re: AIX 4.3 getaddrinfo busted
Previous Message Tom Lane 2009-01-23 17:24:57 Re: AIX 4.3 getaddrinfo busted