Re: Use pread and pwrite instead of lseek + write and read
Victor Wagner <vitus@wagner.pp.ru>
From: Victor Wagner <vitus@wagner.pp.ru>
To: pgsql-hackers@postgresql.org
Date: 2016-08-17T11:03:01Z
Lists: pgsql-hackers
On Wed, 17 Aug 2016 12:17:35 +0200 Magnus Hagander <magnus@hagander.net> wrote: > On Wed, Aug 17, 2016 at 11:34 AM, Victor Wagner <vitus@wagner.pp.ru> > wrote: > > I don't think that all platforms, supported by PostgreSQL support > > this API. Especially, I cannot find any mention of pread/pwrite in > > the Win32 except this thread on stackoverflow: > > > > > Yeah, Windows does not have those API calls, but it shouldn't be > rocket science to write a wrapper for it. The standard windows APIs > can do the same thing -- but they'll need access to the HANDLE for > the file and not the posix file descriptor. There is _get_osfhandle function, which allows to find out Windows HANDLE associated with posix file descriptor. Really my question was - someone should write these wrappers into src/port and add corresponding test to the configure and/or CMakefile for this patch to be complete.
Commits
-
Use pg_pread() and pg_pwrite() for data files and WAL.
- c24dcd0cfd94 12.0 landed