summaryrefslogtreecommitdiff
path: root/src/tools/msvc
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2022-08-05 09:42:31 +1200
committerThomas Munro <tmunro@postgresql.org>2022-08-05 09:49:21 +1200
commitcf112c122060568aa06efe4e6e6fb9b2dd4f1090 (patch)
tree099d16d2064108f43c06d70ab5178a38d8554106 /src/tools/msvc
parent71f5dc6dfb3de50de28ddde53793540c2fa98b1f (diff)
Remove dead pread and pwrite replacement code.
pread() and pwrite() are in SUSv2, and all targeted Unix systems have them. Previously, we defined pg_pread and pg_pwrite to emulate these function with lseek() on old Unixen. The names with a pg_ prefix were a reminder of a portability hazard: they might change the current file position. That hazard is gone, so we can drop the prefixes. Since the remaining replacement code is Windows-only, move it into src/port/win32p{read,write}.c, and move the declarations into src/include/port/win32_port.h. No need for vestigial HAVE_PREAD, HAVE_PWRITE macros as they were only used for declarations in port.h which have now moved into win32_port.h. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Greg Stark <stark@mit.edu> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA+hUKGJ3LHeP9w5Fgzdr4G8AnEtJ=z=p6hGDEm4qYGEUX5B6fQ@mail.gmail.com
Diffstat (limited to 'src/tools/msvc')
-rw-r--r--src/tools/msvc/Mkvcbuild.pm4
-rw-r--r--src/tools/msvc/Solution.pm2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 1ffe6e66d5a..a06dbcae4d2 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -104,13 +104,15 @@ sub mkvcbuild
getaddrinfo.c gettimeofday.c inet_net_ntop.c kill.c open.c
snprintf.c strlcat.c strlcpy.c dirmod.c noblock.c path.c
dirent.c getopt.c getopt_long.c
- pread.c preadv.c pwrite.c pwritev.c pg_bitutils.c
+ preadv.c pwritev.c pg_bitutils.c
pg_strong_random.c pgcheckdir.c pgmkdirp.c pgsleep.c pgstrcasecmp.c
pqsignal.c mkdtemp.c qsort.c qsort_arg.c bsearch_arg.c quotes.c system.c
strerror.c tar.c
win32dlopen.c
win32env.c win32error.c
win32link.c
+ win32pread.c
+ win32pwrite.c
win32ntdll.c
win32security.c win32setlocale.c win32stat.c);
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 5301e01e833..5a461a5212c 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -324,13 +324,11 @@ sub GenerateFiles
HAVE_POSIX_FALLOCATE => undef,
HAVE_PPC_LWARX_MUTEX_HINT => undef,
HAVE_PPOLL => undef,
- HAVE_PREAD => undef,
HAVE_PS_STRINGS => undef,
HAVE_PTHREAD => undef,
HAVE_PTHREAD_BARRIER_WAIT => undef,
HAVE_PTHREAD_IS_THREADED_NP => undef,
HAVE_PTHREAD_PRIO_INHERIT => undef,
- HAVE_PWRITE => undef,
HAVE_READLINE_H => undef,
HAVE_READLINE_HISTORY_H => undef,
HAVE_READLINE_READLINE_H => undef,