Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group