Re: pread() and pwrite()

Thomas Munro <thomas.munro@enterprisedb.com>

From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Jesper Pedersen <jesper.pedersen@redhat.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Magnus Hagander <magnus@hagander.net>, Oskari Saarenmaa <os@ohmu.fi>, Pg Hackers <pgsql-hackers@postgresql.org>, Tobias Oberstein <tobias.oberstein@gmail.com>
Date: 2018-11-05T12:08:37Z
Lists: pgsql-hackers

Attachments

On Sun, Nov 4, 2018 at 12:03 AM Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> On Sat, Nov 3, 2018 at 2:07 AM Jesper Pedersen
> <jesper.pedersen@redhat.com> wrote:
> > This still applies, and passes make check-world.
> >
> > I wonder what the commit policy is on this, if the Windows part isn't
> > included. I read Heikki's comment [1] as it would be ok to commit
> > benefiting all platforms that has pread/pwrite.
>
> Here's a patch to add Windows support by supplying
> src/backend/port/win32/pread.c.  Thoughts?

If we do that, I suppose we might as well supply implementations for
HP-UX 10.20 as well, and then we can get rid of the conditional macro
stuff at various call sites and use pread() and pwrite() freely.
Here's a version that does it that way.  One question is whether the
caveat mentioned in patch 0001 is acceptable.

-- 
Thomas Munro
http://www.enterprisedb.com

Commits

  1. Use pg_pread() and pg_pwrite() for data files and WAL.

  2. Provide pg_pread() and pg_pwrite() for random I/O.

  3. Convert some long lists in configure.in to one-line-per-entry style.