Re: Use pread and pwrite instead of lseek + write and read

From: Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use pread and pwrite instead of lseek + write and read
Date: 2016-08-17 09:34:37
Message-ID: 20160817123437.44f3f60a@fafnir.local.vm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 17 Aug 2016 10:58:09 +0300
Oskari Saarenmaa <os(at)ohmu(dot)fi> wrote:

>
> The attached patch replaces FileWrite and FileRead with FileWriteAt
> and FileReadAt and removes most FileSeek calls. FileSeek is still
> around so we can find the end of a file, but it's not used for
> anything else.

It seems that configure test for availability of pread/pwrite functions
and corresponding #define is needed.

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:

http://stackoverflow.com/questions/766477/are-there-equivalents-to-pread-on-different-platforms

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2016-08-17 09:50:59 Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)
Previous Message Magnus Hagander 2016-08-17 08:45:19 Re: [RFC] Change the default of update_process_title to off