pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Sergey Shinderuk <s.shinderuk@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pg_preadv() and pg_pwritev()
Date: Wed, 13 Jan 2021 15:26:45 -0500
Message-ID: <1305813.1610569605@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+hUKGKAbLqkZsFQ88z64MtYpPzZQhV59YjG3vVzWeGTzbM9+A@mail.gmail.com>
References: <CA+hUKGJA+u-220VONeoREBXJ9P3S94Y7J+kqCnTYmahvZJwM=g@mail.gmail.com>
	<341497.1608420857@sss.pgh.pa.us>
	<CA+hUKG+7UHOH2VGRwvJZ=vXUH9pRA-Tp3gP9EHgtjwzjyfOpWg@mail.gmail.com>
	<20201220224040.evr5pduibvm6dze5@alap3.anarazel.de>
	<CA+hUKG+TCoareSYcAu05yaMh9eUck6Hd8FQZt5VEvotNs3YOMQ@mail.gmail.com>
	<CA+hUKGJ8Ww_fjzUzthdxUF6W3JQ3r=a1hWX7Fcfq9uEndZ_+GQ@mail.gmail.com>
	<CA+hUKGL9XFxM0ZO8ZADYJepSmjywknhnDkKSEttfmn2j9fg0BQ@mail.gmail.com>
	<ed3b8e5d-0da8-6ebd-fd1c-e0ac80a4b204@postgrespro.ru>
	<CA+hUKG+L573j4=XWv6S+r-687Yxn0FyXhtObH9_P-Nu_atL2pQ@mail.gmail.com>
	<448b3cb5-0ba0-6dc5-63c7-789e4eebc40b@postgrespro.ru>
	<1283127.1610554395@sss.pgh.pa.us>
	<CA+hUKGKAbLqkZsFQ88z64MtYpPzZQhV59YjG3vVzWeGTzbM9+A@mail.gmail.com>

Thomas Munro <thomas.munro@gmail.com> writes:
> On Thu, Jan 14, 2021 at 5:13 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Looks like we need to be more careful about not including pread.c
>> in the build unless it actually has code to contribute.

> I did it that way because it made it easy to test different
> combinations of the replacements on computers that do actually have
> pwrite and pwritev, just by tweaking pg_config.h.  Here's an attempt
> to do it with AC_REPLACE_FUNCS, which avoids creating empty .o files.
> It means that to test the replacements on modern systems you have to
> tweak pg_config.h and also add the relevant .o files to LIBOBJS in
> src/Makefile.global, but that seems OK.

Yeah, this looks better.  Two gripes, one major and one minor:

* You need to remove pread.o and pwrite.o from the hard-wired
part of the list in src/port/Makefile, else they get built
whether needed or not.

* I don't much like this in fd.h:

@@ -46,6 +46,7 @@
 #include <dirent.h>
 
 
+struct iovec;
 typedef int File;

because it makes it look like iovec and File are of similar
status, which they hardly are.  Perhaps more like

 #include <dirent.h>
+ 
+struct iovec;			/* avoid including sys/uio.h here */
 
 
 typedef int File;


I confirm clean builds on Big Sur and Catalina with this.

			regards, tom lane





view thread (39+ messages)  latest in thread

Message-ID: <1305813.1610569605@sss.pgh.pa.us>
Permalink:  ../1305813.1610569605@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1305813.1610569605@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, thomas.munro@gmail.com, s.shinderuk@postgrespro.ru
  Subject: Re: pg_preadv() and pg_pwritev()
  In-Reply-To: <1305813.1610569605@sss.pgh.pa.us>

* 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