Re: pg_preadv() and pg_pwritev()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Sergey Shinderuk <s(dot)shinderuk(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_preadv() and pg_pwritev()
Date: 2021-01-13 20:26:45
Message-ID: 1305813.1610569605@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Munro <thomas(dot)munro(at)gmail(dot)com> writes:
> On Thu, Jan 14, 2021 at 5:13 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-01-13 21:01:12 Re: src/tutorial/funcs.source: Wrong comment?
Previous Message Tom Lane 2021-01-13 19:55:19 Re: pgbench and timestamps (bounced)