diff options
author | Thomas Munro | 2022-08-13 20:46:53 +0000 |
---|---|---|
committer | Thomas Munro | 2022-08-13 20:46:53 +0000 |
commit | f5580882856963d1b50f9e391a8dda82d44b69a6 (patch) | |
tree | 4060fab53bd3b3aa98c242d3c258161925522d83 /src/common/ip.c | |
parent | e07ebd4b6e606a7c03ed3c6bf5d6bcbb725247b4 (diff) |
Remove HAVE_UNIX_SOCKETS.
Since HAVE_UNIX_SOCKETS is now defined unconditionally, remove the macro
and drop a small amount of dead code.
The last known systems not to have them (as far as I know at least) were
QNX, which we de-supported years ago, and Windows, which now has them.
If a new OS ever shows up with the POSIX sockets API but without working
AF_UNIX, it'll presumably still be able to compile the code, and fail at
runtime with an unsupported address family error. We might want to
consider adding a HINT that you should turn off the option to use it if
your network stack doesn't support it at that point, but it doesn't seem
worth making the relevant code conditional at compile time.
Also adjust a couple of places in the docs and comments that referred to
builds without Unix-domain sockets, since there aren't any. Windows
still gets a special mention in those places, though, because we don't
try to use them by default there yet.
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
Diffstat (limited to 'src/common/ip.c')
-rw-r--r-- | src/common/ip.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/common/ip.c b/src/common/ip.c index 267103efb9..dd9193feb1 100644 --- a/src/common/ip.c +++ b/src/common/ip.c @@ -38,7 +38,6 @@ -#ifdef HAVE_UNIX_SOCKETS static int getaddrinfo_unix(const char *path, const struct addrinfo *hintsp, struct addrinfo **result); @@ -47,7 +46,6 @@ static int getnameinfo_unix(const struct sockaddr_un *sa, int salen, char *node, int nodelen, char *service, int servicelen, int flags); -#endif /* @@ -62,10 +60,8 @@ pg_getaddrinfo_all(const char *hostname, const char *servname, /* not all versions of getaddrinfo() zero *result on failure */ *result = NULL; -#ifdef HAVE_UNIX_SOCKETS if (hintp->ai_family == AF_UNIX) return getaddrinfo_unix(servname, hintp, result); -#endif /* NULL has special meaning to getaddrinfo(). */ rc = getaddrinfo((!hostname || hostname[0] == '\0') ? NULL : hostname, @@ -87,7 +83,6 @@ pg_getaddrinfo_all(const char *hostname, const char *servname, void pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo *ai) { -#ifdef HAVE_UNIX_SOCKETS if (hint_ai_family == AF_UNIX) { /* struct was built by getaddrinfo_unix (see pg_getaddrinfo_all) */ @@ -101,7 +96,6 @@ pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo *ai) } } else -#endif /* HAVE_UNIX_SOCKETS */ { /* struct was built by getaddrinfo() */ if (ai != NULL) @@ -126,14 +120,12 @@ pg_getnameinfo_all(const struct sockaddr_storage *addr, int salen, { int rc; -#ifdef HAVE_UNIX_SOCKETS if (addr && addr->ss_family == AF_UNIX) rc = getnameinfo_unix((const struct sockaddr_un *) addr, salen, node, nodelen, service, servicelen, flags); else -#endif rc = getnameinfo((const struct sockaddr *) addr, salen, node, nodelen, service, servicelen, @@ -151,8 +143,6 @@ pg_getnameinfo_all(const struct sockaddr_storage *addr, int salen, } -#if defined(HAVE_UNIX_SOCKETS) - /* ------- * getaddrinfo_unix - get unix socket info using IPv6-compatible API * @@ -286,4 +276,3 @@ getnameinfo_unix(const struct sockaddr_un *sa, int salen, return 0; } -#endif /* HAVE_UNIX_SOCKETS */ |