AF_UNSPEC vs PF_UNSPEC - Mailing list pgsql-hackers

From Tom Lane
Subject AF_UNSPEC vs PF_UNSPEC
Date
Msg-id 28023.1397665583@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
While wondering what the heck is going on in
http://www.postgresql.org/message-id/534E8FBB.9060006@gmail.com
I chanced to notice that pgstat.c and a couple of other places set
up arguments for getaddrinfo() like this:
hints.ai_family = PF_UNSPEC;

whereas the Single Unix Spec says clearly that AF_UNSPEC is what
to write if you're not intending to constrain the address family.
AF_UNSPEC is what we use in the majority of places, too.

On Linux, at least, these symbols have the same value so it doesn't
matter; but I wonder whether they are different on recent Cygwin.

Anyway, I think this is clearly wrong and we should change it.
I see a "PF_INET" that presumably ought to be "AF_INET" in
pg_dump/parallel.c, too.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Dynamic Background Workers and clean exit
Next
From: Andres Freund
Date:
Subject: Re: bgworker crashed or not?