From: ilmari@ilmari.org
To: Magnus Hagander <magnus@hagander.net>
Cc: Victor Wagner <vitus@wagner.pp.ru>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Use pread and pwrite instead of lseek + write and read
Date: Wed, 17 Aug 2016 11:41:40 +0100
Message-ID: <d8jwpjf4qzf.fsf@dalvik.ping.uio.no> (raw)
In-Reply-To: <CABUevEzZ=CGdmwSZwW9oNuf4pQZMExk33jcNO7rseqrAgKzj5Q@mail.gmail.com>
References: <a86bd200-ebbe-d829-e3ca-0c4474b2fcb7@ohmu.fi>
<20160817123437.44f3f60a@fafnir.local.vm>
<CABUevEzZ=CGdmwSZwW9oNuf4pQZMExk33jcNO7rseqrAgKzj5Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Magnus Hagander <magnus@hagander.net> writes:
[pread/pwrite]
> 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.
>
> It also has things like ReadFileScatter() (
> https://msdn.microsoft.com/en-us/library/windows/desktop/aa365469(v=vs.85).aspx)
> which is not the same, but might also be interesting as a future
> improvement.
That looks a lot like POSIX readv()
(http://pubs.opengroup.org/onlinepubs/9699919799/functions/readv.html),
and as far as I can tell it has the same issue as it in that it doesn't
take an offset argument, but requires you to seek first.
Linux and modern BSDs however have preadv()
(http://manpages.ubuntu.com/manpages/xenial/en/man2/preadv.2.html),
which takes an offset and an iovec array. I don't know if Windows and
other platforms have anything similar.
--
- Twitter seems more influential [than blogs] in the 'gets reported in
the mainstream press' sense at least. - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
to a mainstream media article. - Calle Dybedahl
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: ilmari@ilmari.org, magnus@hagander.net, vitus@wagner.pp.ru
Subject: Re: Use pread and pwrite instead of lseek + write and read
In-Reply-To: <d8jwpjf4qzf.fsf@dalvik.ping.uio.no>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox