Re: pread() and pwrite()

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Oskari Saarenmaa <os(at)ohmu(dot)fi>, Tobias Oberstein <tobias(dot)oberstein(at)gmail(dot)com>
Subject: Re: pread() and pwrite()
Date: 2018-07-20 07:56:51
Message-ID: 6cc7c8dd-29f9-7d75-d18a-99f19c076d10@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 20/07/18 01:50, Thomas Munro wrote:
> An idea for how to handle Windows, in a follow-up patch: add a file
> src/backend/port/win32/file.c that defines pgwin32_pread() and
> pgwin32_pwrite(), wrapping WriteFile()/ReadFile() and passing in an
> "OVERLAPPED" struct with the offset and sets errno on error, then set
> up the macros so that Windows can use them as pread(), pwrite(). It
> might also be necessary to open all files with FILE_FLAG_OVERLAPPED.
> Does any Windows hacker have a bettter idea, and/or want to try to
> write that patch? Otherwise I'll eventually try to do some long
> distance hacking on AppVeyor.

No objections, if you want to make the effort. But IMHO the lseek+read
fallback is good enough on Windows. Unless you were thinking that we
could then remove the !HAVE_PREAD fallback altogether. Are there any
other platforms out there that don't have pread/pwrite that we care about?

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oskari Saarenmaa 2018-07-20 08:14:59 Re: pread() and pwrite()
Previous Message Nikhil Sontakke 2018-07-20 06:43:19 Re: [HACKERS] logical decoding of two-phase transactions