From 98e93a1fc93e9b54eb477d870ec744e9e1669f34 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 11 Jan 2022 13:46:12 -0500 Subject: Clean up messy API for src/port/thread.c. The point of this patch is to reduce inclusion spam by not needing to #include or in port.h (which is read by every compile in our tree). To do that, we must remove port.h's declarations of pqGetpwuid and pqGethostbyname. pqGethostbyname is only used, and is only ever likely to be used, in src/port/getaddrinfo.c --- which isn't even built on most platforms, making pqGethostbyname dead code for most people. Hence, deal with that by just moving it into getaddrinfo.c. To clean up pqGetpwuid, invent a couple of simple wrapper functions with less-messy APIs. This allows removing some duplicate error-handling code, too. In passing, remove thread.c from the MSVC build, since it contains nothing we use on Windows. Noted while working on 376ce3e40. Discussion: https://postgr.es/m/1634252654444.90107@mit.edu --- src/interfaces/libpq/fe-auth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/interfaces/libpq/fe-auth.h') diff --git a/src/interfaces/libpq/fe-auth.h b/src/interfaces/libpq/fe-auth.h index 16d5e1da0f0..f22b3fe6488 100644 --- a/src/interfaces/libpq/fe-auth.h +++ b/src/interfaces/libpq/fe-auth.h @@ -20,6 +20,7 @@ /* Prototypes for functions in fe-auth.c */ extern int pg_fe_sendauth(AuthRequest areq, int payloadlen, PGconn *conn); +extern char *pg_fe_getusername(uid_t user_id, PQExpBuffer errorMessage); extern char *pg_fe_getauthname(PQExpBuffer errorMessage); /* Mechanisms in fe-auth-scram.c */ -- cgit v1.2.3