Re: [HACKERS] [PATCH] Better way to check for getaddrinfo

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "R, Rajesh (STSD)" <rajesh(dot)r2(at)hp(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [HACKERS] [PATCH] Better way to check for getaddrinfo
Date: 2006-01-26 18:49:34
Message-ID: 200601261849.k0QInY012282@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I am not sure what to do on this. Right now we have a one-line test:
> > AC_REPLACE_FUNCS([getaddrinfo])
> > To test for a macro we are going to need to add include netdb.h, and the
> > LINK test below is overkill. I am thinking we should just hard-code in
> > HAVE_GETADDRINFO for the True64 platform; anything more is going to be
> > just a Tru64 hack anyway.
>
> I still want to understand why any change is needed at all. There must
> be something very peculiar about getaddrinfo on Tru64 if the original
> coding doesn't work. Why is it different from every other function we
> test for?

I have the answer. Tru64 netdb.h has:

#if defined (_SOCKADDR_LEN) || defined (_XOPEN_SOURCE_EXTENDED)
#define getaddrinfo ngetaddrinfo
#else
#define getaddrinfo ogetaddrinfo
#endif

so it is a macro, and configure produces this line:

#undef $ac_func

meaning that even if we added #include <netdb.h>, our configure test
still would not work.

Perhaps we should just test for ngetaddrinfo on that platform, and
define HAVE_GETADDRINFO.

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2006-01-26 19:00:26 Re: Arrays
Previous Message Doug McNaught 2006-01-26 18:32:03 Re: Access Problem After Version Upgrade -- FIXED

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-01-26 19:06:50 Re: [HACKERS] [PATCH] Better way to check for getaddrinfo
Previous Message Tom Lane 2006-01-26 18:04:53 Re: [HACKERS] [PATCH] Better way to check for getaddrinfo

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-01-26 18:55:17 Re: BUG #2195: log_min_messages crash server when in DEBUG3 to
Previous Message Tom Lane 2006-01-26 18:04:53 Re: [HACKERS] [PATCH] Better way to check for getaddrinfo