diff --git a/configure b/configure index 842ef855fc..4a8f652129 100755 --- a/configure +++ b/configure @@ -10728,7 +10728,6 @@ fi # # For each platform, we need to know about any special compile and link # libraries, and whether the normal C function names are thread-safe. -# See the comment at the top of src/port/thread.c for more information. # WIN32 doesn't need the pthread tests; it always uses threads # # These tests are run before the library-tests, because linking with the diff --git a/configure.ac b/configure.ac index 2c18a64b0f..0f802f3df4 100644 --- a/configure.ac +++ b/configure.ac @@ -1232,7 +1232,6 @@ fi # # For each platform, we need to know about any special compile and link # libraries, and whether the normal C function names are thread-safe. -# See the comment at the top of src/port/thread.c for more information. # WIN32 doesn't need the pthread tests; it always uses threads # # These tests are run before the library-tests, because linking with the diff --git a/src/bin/psql/nls.mk b/src/bin/psql/nls.mk index cf0b800291..8624612969 100644 --- a/src/bin/psql/nls.mk +++ b/src/bin/psql/nls.mk @@ -23,7 +23,7 @@ GETTEXT_FILES = $(FRONTEND_COMMON_GETTEXT_FILES) \ ../../common/fe_memutils.c \ ../../common/username.c \ ../../common/wait_error.c \ - ../../port/thread.c + ../../port/user.c GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) \ HELP0 HELPN N_ simple_prompt simple_prompt_extended GETTEXT_FLAGS = $(FRONTEND_COMMON_GETTEXT_FLAGS) \ diff --git a/src/include/port.h b/src/include/port.h index a88d403483..5979139ebc 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -432,7 +432,7 @@ extern size_t strlcpy(char *dst, const char *src, size_t siz); extern size_t strnlen(const char *str, size_t maxlen); #endif -/* thread.c */ +/* port/user.c */ #ifndef WIN32 extern bool pg_get_user_name(uid_t user_id, char *buffer, size_t buflen); extern bool pg_get_user_home_dir(uid_t user_id, char *buffer, size_t buflen); diff --git a/src/interfaces/libpq/nls.mk b/src/interfaces/libpq/nls.mk index 5959fa0c07..40b662dc08 100644 --- a/src/interfaces/libpq/nls.mk +++ b/src/interfaces/libpq/nls.mk @@ -13,7 +13,7 @@ GETTEXT_FILES = fe-auth.c \ fe-secure-gssapi.c \ fe-secure-openssl.c \ win32.c \ - ../../port/thread.c + ../../port/user.c GETTEXT_TRIGGERS = libpq_append_conn_error:2 \ libpq_append_error:2 \ libpq_gettext \ diff --git a/src/port/Makefile b/src/port/Makefile index 711f59e32b..f205c2c9c5 100644 --- a/src/port/Makefile +++ b/src/port/Makefile @@ -59,7 +59,7 @@ OBJS = \ snprintf.o \ strerror.o \ tar.o \ - thread.o + user.o # libpgport.a, libpgport_shlib.a, and libpgport_srv.a contain the same files # foo.o, foo_shlib.o, and foo_srv.o are all built from foo.c @@ -84,10 +84,6 @@ libpgport.a: $(OBJS) rm -f $@ $(AR) $(AROPT) $@ $^ -# thread.o and thread_shlib.o need PTHREAD_CFLAGS (but thread_srv.o does not) -thread.o: CFLAGS+=$(PTHREAD_CFLAGS) -thread_shlib.o: CFLAGS+=$(PTHREAD_CFLAGS) - # all versions of pg_crc32c_sse42.o need CFLAGS_CRC pg_crc32c_sse42.o: CFLAGS+=$(CFLAGS_CRC) pg_crc32c_sse42_shlib.o: CFLAGS+=$(CFLAGS_CRC) diff --git a/src/port/meson.build b/src/port/meson.build index 24416b9bfc..9d0cd93c43 100644 --- a/src/port/meson.build +++ b/src/port/meson.build @@ -20,7 +20,7 @@ pgport_sources = [ 'snprintf.c', 'strerror.c', 'tar.c', - 'thread.c', + 'user.c', ] if host_system == 'windows' diff --git a/src/port/thread.c b/src/port/user.c similarity index 88% rename from src/port/thread.c rename to src/port/user.c index 375c89b297..d278684fe2 100644 --- a/src/port/thread.c +++ b/src/port/user.c @@ -1,13 +1,12 @@ /*------------------------------------------------------------------------- * - * thread.c + * user.c * - * Prototypes and macros around system calls, used to help make - * threaded libraries reentrant and safe to use from threaded applications. + * Wrapper functions for user and home directory lookup. * * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group * - * src/port/thread.c + * src/port/user.c * *------------------------------------------------------------------------- */ @@ -16,12 +15,6 @@ #include - -/* - * Historically, the code in this module had to deal with operating systems - * that lacked getpwuid_r(). - */ - #ifndef WIN32 /*