Re: pread() and pwrite()
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Thomas Munro <thomas.munro@enterprisedb.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Oskari Saarenmaa <os@ohmu.fi>,
Tobias Oberstein <tobias.oberstein@gmail.com>
Date: 2018-07-20T07:56:51Z
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
Commits
-
Use pg_pread() and pg_pwrite() for data files and WAL.
- c24dcd0cfd94 12.0 landed
-
Provide pg_pread() and pg_pwrite() for random I/O.
- 3fd2a7932ef0 12.0 landed
-
Convert some long lists in configure.in to one-line-per-entry style.
- bfa6c5a0c974 12.0 landed