pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove dead pread and pwrite replacement code.
Date: Thu, 04 Aug 2022 21:59:42 +0000
Message-ID: <E1oJisY-000Kn0-16@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cf112c122060568aa06efe4e6e6fb9b2dd4f1090

Modified Files
--------------
configure                                       | 38 ++++++-------------
configure.ac                                    |  4 +-
contrib/pg_stat_statements/pg_stat_statements.c |  4 +-
src/backend/access/heap/rewriteheap.c           |  2 +-
src/backend/access/transam/slru.c               |  4 +-
src/backend/access/transam/xlog.c               |  4 +-
src/backend/access/transam/xlogreader.c         |  2 +-
src/backend/access/transam/xlogrecovery.c       |  2 +-
src/backend/replication/basebackup.c            |  2 +-
src/backend/replication/walreceiver.c           |  2 +-
src/backend/storage/file/fd.c                   |  4 +-
src/backend/utils/init/miscinit.c               |  2 +-
src/bin/pg_test_fsync/pg_test_fsync.c           | 50 ++++++++++++-------------
src/include/access/xlogreader.h                 |  4 +-
src/include/pg_config.h.in                      |  6 ---
src/include/port.h                              | 19 ----------
src/include/port/win32_port.h                   |  6 +++
src/port/preadv.c                               |  4 +-
src/port/pwritev.c                              |  4 +-
src/port/{pread.c => win32pread.c}              | 22 ++---------
src/port/{pwrite.c => win32pwrite.c}            | 22 ++---------
src/tools/msvc/Mkvcbuild.pm                     |  4 +-
src/tools/msvc/Solution.pm                      |  2 -
23 files changed, 76 insertions(+), 137 deletions(-)



Message-ID: <E1oJisY-000Kn0-16@gemulon.postgresql.org>
Permalink:  ../E1oJisY-000Kn0-16@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oJisY-000Kn0-16@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org
  Subject: Re: pgsql: Remove dead pread and pwrite replacement code.
  In-Reply-To: <E1oJisY-000Kn0-16@gemulon.postgresql.org>
  References: <E1oJisY-000Kn0-16@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox