Re: O_DIRECT on macOS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: O_DIRECT on macOS
Date: 2021-07-19 14:13:27
Message-ID: 234364.1626704007@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 Mon, Jul 19, 2021 at 4:42 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> prairiedog thinks that Assert is too optimistic about whether all
>> those flags exist.

> Fixed.

Hmm ... we used to have to avoid putting #if constructs in the arguments
of macros (such as StaticAssertStmt). Maybe that's not a thing anymore
with C99, and in any case this whole stanza is fairly platform-specific
so we may not run into a compiler that complains. But my hindbrain wants
to see this done with separate statements, eg

#if defined(O_CLOEXEC)
StaticAssertStmt((PG_O_DIRECT & O_CLOEXEC) == 0,
"PG_O_DIRECT collides with O_CLOEXEC");
#endif

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-07-19 14:19:02 Re: Failure with 004_logrotate in prairiedog
Previous Message Yugo NAGATA 2021-07-19 14:11:29 Re: Question about non-blocking mode in libpq