Re: Use pread and pwrite instead of lseek + write and read - Mailing list pgsql-hackers

From Victor Wagner
Subject Re: Use pread and pwrite instead of lseek + write and read
Date
Msg-id 20160817140301.4fd397d2@fafnir.local.vm
Whole thread Raw
In response to Re: Use pread and pwrite instead of lseek + write and read  (Magnus Hagander <magnus@hagander.net>)
List 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.






pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Use pread and pwrite instead of lseek + write and read
Next
From: Greg Stark
Date:
Subject: Re: Why we lost Uber as a user