Re: pread() and pwrite()

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Oskari Saarenmaa <os(at)ohmu(dot)fi>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Tobias Oberstein <tobias(dot)oberstein(at)gmail(dot)com>
Subject: Re: pread() and pwrite()
Date: 2018-11-05 12:08:37
Message-ID: CAEepm=3QOz_BEP9tz66q6tXg=dKkXCnkzo_VcFttajgpTNTS+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 4, 2018 at 12:03 AM Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> On Sat, Nov 3, 2018 at 2:07 AM Jesper Pedersen
> <jesper(dot)pedersen(at)redhat(dot)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

Attachment Content-Type Size
0001-Supply-pread-pwrite-where-missing-v9.patch application/octet-stream 9.1 KB
0002-Use-pread-pwrite-instead-of-lseek-read-write-v9.patch application/octet-stream 23.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2018-11-05 12:32:06 Re: Undo worker and transaction rollback
Previous Message Kuntal Ghosh 2018-11-05 11:42:40 Re: POC: Cleaning up orphaned files using undo logs