Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZyeh-0000SK-Ep for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Aug 2016 11:05:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bZyeg-0000Km-5q for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Aug 2016 11:05:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bZydI-0007Ge-Ra for pgsql-hackers@postgresql.org; Wed, 17 Aug 2016 11:03:40 +0000 Received: from mx.wagner.pp.ru ([78.46.190.96]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZycx-0004Sf-WD for pgsql-hackers@postgresql.org; Wed, 17 Aug 2016 11:03:27 +0000 Received: from mail.wagner.pp.ru (unknown [192.168.217.131]) by mx.wagner.pp.ru (Postfix) with ESMTP id 773B3E0959 for ; Wed, 17 Aug 2016 14:03:02 +0300 (MSK) Received: from fafnir.local.vm (newmail.postgrespro.ru [93.174.131.138]) by mail.wagner.pp.ru (Postfix) with ESMTPSA id 0C433212B8 for ; Wed, 17 Aug 2016 14:03:02 +0300 (MSK) Date: Wed, 17 Aug 2016 14:03:01 +0300 From: Victor Wagner To: pgsql-hackers@postgresql.org Subject: Re: Use pread and pwrite instead of lseek + write and read Message-ID: <20160817140301.4fd397d2@fafnir.local.vm> In-Reply-To: References: <20160817123437.44f3f60a@fafnir.local.vm> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Wed, 17 Aug 2016 12:17:35 +0200 Magnus Hagander wrote: > On Wed, Aug 17, 2016 at 11:34 AM, Victor Wagner > 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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers