From d22cc7326ce0fe5033f2c6e3f711047d263c1c86 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Thu, 13 Nov 2025 16:35:07 +0100 Subject: Document that pg_getaddrinfo_all does not accept null hints While the underlying getaddrinfo call accepts a null pointer for the hintp parameter, pg_getaddrinfo_all does not. Document this difference with a comment to make it clear. Author: Daniel Gustafsson Reviewed-by: Tom Lane Reported-by: Sergey Tatarintsev Discussion: https://postgr.es/m/1e5efc94-407e-40b8-8b10-4d25f823c6d7@postgrespro.ru --- src/common/ip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/ip.c b/src/common/ip.c index 0e7897a5c8f..71e5934557e 100644 --- a/src/common/ip.c +++ b/src/common/ip.c @@ -48,6 +48,9 @@ static int getnameinfo_unix(const struct sockaddr_un *sa, int salen, /* * pg_getaddrinfo_all - get address info for Unix, IPv4 and IPv6 sockets + * + * The API of this routine differs from the standard getaddrinfo() definition + * in that it requires a valid hintp, a null pointer is not allowed. */ int pg_getaddrinfo_all(const char *hostname, const char *servname, -- cgit v1.2.3