summaryrefslogtreecommitdiff
path: root/src/port
diff options
context:
space:
mode:
authorThomas Munro2023-07-09 06:12:28 +0000
committerThomas Munro2023-07-09 06:17:09 +0000
commit89333db963af20988fc407463ea626b1c41404e8 (patch)
tree7ace29b3d93e982380b42cac142f6ad7f4f23f1b /src/port
parentc23e7ea4d6a44cd0f6948d362a8477f14a3f849c (diff)
Rename port/thread.c to port/user.c.
Historically this module dealt with thread-safety of system interfaces, but now all that's left is wrapper code for user name and home directory lookup. Arguably the Windows variants of this logic could be moved in here too, to justify its presence under port. For now, just tidy up some obsolete references to multi-threading, and give the file a meaningful name. Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Discussion: https://postgr.es/m/CA%2BhUKGLtmexrpMtxBRLCVePqV_dtWG-ZsEbyPrYc%2BNBB2TkNsw%40mail.gmail.com
Diffstat (limited to 'src/port')
-rw-r--r--src/port/Makefile6
-rw-r--r--src/port/meson.build2
-rw-r--r--src/port/user.c (renamed from src/port/thread.c)13
3 files changed, 5 insertions, 16 deletions
diff --git a/src/port/Makefile b/src/port/Makefile
index 711f59e32bd..f205c2c9c50 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 24416b9bfc0..9d0cd93c438 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
index 375c89b2974..d278684fe29 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 <pwd.h>
-
-/*
- * Historically, the code in this module had to deal with operating systems
- * that lacked getpwuid_r().
- */
-
#ifndef WIN32
/*