aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
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/backend/storage/file/fd.c
parent71f5dc6dfb3de50de28ddde53793540c2fa98b1f (diff)
downloadpostgresql-cf112c122060568aa06efe4e6e6fb9b2dd4f1090.tar.gz
postgresql-cf112c122060568aa06efe4e6e6fb9b2dd4f1090.zip
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/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 447d5a86c30..3d1a9733549 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -2063,7 +2063,7 @@ FileRead(File file, char *buffer, int amount, off_t offset,
retry:
pgstat_report_wait_start(wait_event_info);
- returnCode = pg_pread(vfdP->fd, buffer, amount, offset);
+ returnCode = pread(vfdP->fd, buffer, amount, offset);
pgstat_report_wait_end();
if (returnCode < 0)
@@ -2145,7 +2145,7 @@ FileWrite(File file, char *buffer, int amount, off_t offset,
retry:
errno = 0;
pgstat_report_wait_start(wait_event_info);
- returnCode = pg_pwrite(VfdCache[file].fd, buffer, amount, offset);
+ returnCode = pwrite(VfdCache[file].fd, buffer, amount, offset);
pgstat_report_wait_end();
/* if write didn't set errno, assume problem is no disk space */