#
# 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
#
# 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
../../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) \
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);
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 \
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
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)
'snprintf.c',
'strerror.c',
'tar.c',
- 'thread.c',
+ 'user.c',
]
if host_system == 'windows'
/*-------------------------------------------------------------------------
*
- * 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
*
*-------------------------------------------------------------------------
*/
#include <pwd.h>
-
-/*
- * Historically, the code in this module had to deal with operating systems
- * that lacked getpwuid_r().
- */
-
#ifndef WIN32
/*